summaryrefslogtreecommitdiff
path: root/security/mhash/files/patch-lib-whirlpool.c
blob: b4995a224644c7c59cff75c749edef1933700a3e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Description: Protect some macro parameters with parentheses.
Author: Peter Pentchev <roam@FreeBSD.org>
Forwarded: http://sourceforge.net/mailarchive/message.php?msg_name=20090910102100.GA26539%40straylight.m.ringlet.net
Last-Update: 2009-09-10

--- lib/whirlpool.c.orig
+++ lib/whirlpool.c
@@ -883,10 +883,10 @@
  * Increment the block counter by step
  */
 #define INCCTR(cnt,step) do {        \
- if ((cnt[3] += (step)) < (step))    \
-   if (!(++cnt[2]))                  \
-     if (!(++cnt[1]))                \
-       if (!(++cnt[0]));             \
+ if (((cnt)[3] += (step)) < (step))    \
+   if (!(++(cnt)[2]))                  \
+     if (!(++(cnt)[1]))                \
+       if (!(++(cnt)[0]));             \
 } while(0);