kernel-pfroute: Fix mixed up memset() call in get_route()
authorMathias Krause <minipli@googlemail.com>
Thu, 29 Aug 2013 16:21:58 +0000 (18:21 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 29 Aug 2013 16:56:39 +0000 (18:56 +0200)
The retry code introduced in dc8b083 got the memset() arguments wrong.
Fix this to ensure the buffer gets zeroed, for real.

It probably doesn't matter as we do reset the message length on retry, so
the stale data shouldn't be seen by anyone.

Found-by: git grep 'memset\s*\([^,]*,\s*[^,]*,\s*0\s*\)'
src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c

index f432ecd..bc10610 100644 (file)
@@ -1568,7 +1568,7 @@ retry:
                        src = NULL;
                        msg.hdr.rtm_seq = ref_get(&this->seq);
                        msg.hdr.rtm_addrs = 0;
-                       memset(msg.buf, sizeof(msg.buf), 0);
+                       memset(msg.buf, 0, sizeof(msg.buf));
                        goto retry;
                }
                DBG1(DBG_KNL, "PF_ROUTE lookup failed: %s", strerror(errno));