[PATCH] * random/random-drbg.c (drbg_hmac_update): Don't memset if, length is zero

Kristian Fiskerstrand kristian.fiskerstrand at sumptuouscapital.com
Wed Jan 25 22:25:36 CET 2017

[resending as previous message was sent using a non-subscribed addresse,
please excuse any duplicate]

* random/random-drbg.c (drbg_hmac_update): Don't memset if length is zero

A zero length memset triggers __warn_memset_zero_len() in glibc, so
only invoking memset if non-zero value

A user reported an issue in

/usr/include/bits/string3.h:86:7: warning: call to
'__warn_memset_zero_len' declared with attribute warning: memset used
with constant zero length parameter; this could be due to transposed
       __warn_memset_zero_len ();

which subsequently resulted in linking error for
./.libs/libgcrypt.so: undefined reference to `__warn_memset_zero_len'

Kristian Fiskerstrand
Blog: https://blog.sumptuouscapital.com
Twitter: @krifisk
Public OpenPGP keyblock at hkp://pool.sks-keyservers.net
fpr:94CB AFDD 3034 5109 5618 35AA 0B7F 8B60 E3ED FAE3
"Money is better than poverty, if only for financial reasons."
(Woody Allen)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-random-random-drbg.c-drbg_hmac_update-Don-t-memset-i.patch
Type: text/x-patch
Size: 1469 bytes
Desc: not available
URL: </pipermail/attachments/20170125/a4583bb6/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: </pipermail/attachments/20170125/a4583bb6/attachment-0001.sig>

More information about the Gnupg-devel mailing list