[PATCH] off by one error in nis-publickey

Ulrich Drepper drepper@redhat.com
Fri Oct 28 22:45:00 GMT 2005


Thorsten Kukuk wrote:
> there is a off by one error in nis-publickey:

While this is correct for the current definition of the array the
question is why is the array and the strncpy not defined as 2 *
HEXKEYBYTES + 1.

The memcmp starts at HEXKEYBYTES and continues for KEYCHECKSUMSIZE.  In
fact, the array should be HEXKEYBYTES + KEYCHECKSUMSIZE in size (no NUL
byte needed).  So, why doesn't it do it like this?

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/libc-hacker/attachments/20051028/24409532/attachment.sig>


More information about the Libc-hacker mailing list