6729ff
commit 45a1cbb7514f9db5fe2d7c2207d7723092aa164d
6729ff
Author:     Volker Lendecke <vl@samba.org>
6729ff
AuthorDate: Thu Jul 11 14:57:53 2013 +0200
6729ff
Commit:     Karolin Seeger <kseeger@samba.org>
6729ff
CommitDate: Mon Oct 14 10:11:48 2013 +0200
6729ff
6729ff
    ccan: Fix calling memset with zero length parameter
6729ff
    
6729ff
    Signed-off-by: Volker Lendecke <vl@samba.org>
6729ff
    Reviewed-by: Andreas Schneider <asn@samba.org>
6729ff
    
6729ff
    Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
6729ff
    Autobuild-Date(master): Thu Jul 11 16:55:49 CEST 2013 on sn-devel-104
6729ff
    
6729ff
    Signed-off-by: Andreas Schneider <asn@samba.org>
6729ff
    
6729ff
    Fix bug #10190 - Fix memset used with constant zero length parameter.
6729ff
---
6729ff
 lib/ccan/tally/tally.c | 2 +-
6729ff
 1 file changed, 1 insertion(+), 1 deletion(-)
6729ff
6729ff
diff --git a/lib/ccan/tally/tally.c b/lib/ccan/tally/tally.c
6729ff
index 774373c..29f0555 100644
6729ff
--- a/lib/ccan/tally/tally.c
6729ff
+++ b/lib/ccan/tally/tally.c
6729ff
@@ -506,11 +506,11 @@ char *tally_histogram(const struct tally *tally,
6729ff
 
6729ff
 		if (count > covered) {
6729ff
 			count -= covered;
6729ff
+			memset(p, '*', count);
6729ff
 		} else {
6729ff
 			count = 0;
6729ff
 		}
6729ff
 
6729ff
-		memset(p, '*', count);
6729ff
 		p += count;
6729ff
 		*p = '\n';
6729ff
 		p++;