Re: [PATCH] nfs client, kernel 2.4.31: readlink result overflow

From: Peter Staubach
Date: Tue Sep 13 2005 - 15:47:44 EST


Assar wrote:

If thats the reason, you don't need the "-1" there?



It also writes a 0 byte. I think it looks like this:

---- ------------ -
len string... 0

-


NFS uses XDR to encode C strings. They are encoded as counted byte arrays
and are _not_ null terminated. The space containing the string is rounded
up to the next 4 byte boundary though and, usually, this space is zero filled.
The number of bytes in the string is encoded as a big endian integer in the
first four bytes.

Thanx...

ps
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/