valgrind complains mpicoder.c:273

Rik Snel rik at snel.it
Sun Aug 19 12:55:37 CEST 2012


Hi list,

I was analyzing a program I am writing with valgrind, and I found a
small issue with libgcrypt.

Line 273 of mpicoder.c says:
 for (p=buffer; !*p && *nbytes; p++, --*nbytes)

In the case of getting a buffer with *nbytes == 0, *p will be
uninitialized. 

I recommend switchting !*p and *nbytes, thus changing mpicoder.c:273 to
 for (p=byffer; *nbytes && !*p; p++, --*nbytes)

Greetings,

Rik.

-- 
Nothing is ever a total loss; it can always serve as a bad example.



More information about the Gcrypt-devel mailing list