summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-05-27 15:48:35 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-05-27 15:48:35 +0200
commitd927329b2f6fe92d6be8eaee7896fa284ab43033 (patch)
tree9327ebfa92aa5823e886a1c9f325e844c3156588
parent6cd01f6f8f5fe4a85d4df3febec4d9133e360b72 (diff)
downloadlibtasn1-d927329b2f6fe92d6be8eaee7896fa284ab43033.tar.gz
libtasn1-d927329b2f6fe92d6be8eaee7896fa284ab43033.tar.bz2
libtasn1-d927329b2f6fe92d6be8eaee7896fa284ab43033.zip
safe_memset: allow memset of zero bytes.
-rw-r--r--lib/gstr.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gstr.h b/lib/gstr.h
index 34e8153..00c335c 100644
--- a/lib/gstr.h
+++ b/lib/gstr.h
@@ -36,7 +36,7 @@ void safe_memset(void *data, int c, size_t size)
* sent by David Jacobson in the openssl-dev mailing list.
*/
- do {
+ if (size > 0) do {
memset(data, c, size);
} while(vdata[volatile_zero] != c);
}