Re: 2.1.20 ext2fs readlink bug+fix

Lars Wirzenius (liw@iki.fi)
Sat, 11 Jan 1997 06:07:24 +0200


--==_Exmh_-1767204464P
Content-Type: text/plain; charset=us-ascii

[ 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.

--==_Exmh_-1767204464P Content-Type: application/pgp-signature

-----BEGIN PGP MESSAGE----- Version: 2.6.3i

iQCVAwUBMtcR9oQRll5MupLRAQFtzgQAkp2U9KNWjGFQlo72Cli+l2fxLSuEOUpO 30XQTYaYNj810b1sdcnLtZmDh1fRy9ftds7L+TpkWOGY9YXig9G437J06jL4NlFD afUC68yzo1okMHSQck2yUaSnKAimpikCaao8eLCyrgkZtMFyx+tVa2GedVT5Otfi e7vuiXXTr2w= =vhkR -----END PGP MESSAGE-----

--==_Exmh_-1767204464P--