lkml.org 
[lkml]   [1997]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: 2.1.20 ext2fs readlink bug+fix
Date
[ Please don't Cc: me when replying to my message on a mailing list. ]

Greg Alexander:
> Before doing strlen on it, you should put a null as the last
> byte in the array (unless it's dynamic, in which case we might be kinda
> screwed).

Would it be better to check if it is zero terminated?

{
char *p = memchr(link, '\0', max_length);
if (p == NULL)
oops();
i = p - link;
}

(Or something. I'm not a kernel programmer.)

--
Please read <http://www.iki.fi/liw/mail-to-lasu.html> before mailing me.
Please don't Cc: me when replying to my message on a mailing list.


[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.072 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site