From 153b8979842f603fc55643f3991dfb6fae7ed997 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 5 Nov 2017 17:08:02 +0100 Subject: [PATCH] helper.pl - detect sizeof without brackets (cherry picked from commit b7e35e9f57f5747d497e1101a624092b8b633302) --- helper.pl | 1 + src/ciphers/des.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/helper.pl b/helper.pl index bd32378..591ce18 100755 --- a/helper.pl +++ b/helper.pl @@ -55,6 +55,7 @@ sub check_source { push @{$troubles->{unwanted_strcmp}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bstrcmp\s*\(/; push @{$troubles->{unwanted_clock}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bclock\s*\(/; push @{$troubles->{unwanted_qsort}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bqsort\s*\(/; + push @{$troubles->{sizeof_no_brackets}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bsizeof\s*[^\(]/; if ($file =~ m|src/.*\.c$| && $file !~ m|src/ciphers/.*\.c$| && $file !~ m|src/hashes/.*\.c$| && diff --git a/src/ciphers/des.c b/src/ciphers/des.c index cbb20e3..2866054 100644 --- a/src/ciphers/des.c +++ b/src/ciphers/des.c @@ -1383,7 +1383,7 @@ static void cookey(const ulong32 *raw1, ulong32 *keyout) *cook++ |= (*raw1 & 0x0000003fL); } - XMEMCPY(keyout, dough, sizeof dough); + XMEMCPY(keyout, dough, sizeof(dough)); } #ifdef LTC_CLEAN_STACK