[strongSwan-dev] [PATCH] kernel-pfroute: Fix mixed up memset() call in get_route()
Mathias Krause
minipli at googlemail.com
Thu Aug 29 18:21:58 CEST 2013
The retry code introduced in dc8b083 "kernel-pfroute: Retry route lookup
without source address on failure" 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*\)'
Signed-off-by: Mathias Krause <minipli at googlemail.com>
---
src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c
index f432ecd..bc10610 100644
--- a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c
+++ b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c
@@ -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));
--
1.7.10.4
More information about the Dev
mailing list