Re: [AD] 3 patches regarding unicode and buffer overfows (mostly)

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> It seems she mainly got caught by ustrn* using bytes rather than unicode
> characters :P

And it seems I got caught by the docs :-(

Annie wrote:
> Since there is a call to ustrncpy(dest, buf, size-ucwidth(0)) in both
> fix_filename_path and replace_filename, the size parameter should be in
> bytes (or does these functions have changed?)

You're right, I should have read the code because the docs aren't very
helpful:

"char *fix_filename_path(char *dest, const char *path, int size);
Converts a partial filename into a full path, generating up to the specified
maximum number of characters. Returns a copy of the dest parameter. "

--
Eric Botcazou
ebotcazou@xxxxxxxxxx



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/