projects
/
project
/
netifd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
netifd: fix incorrect number of bytes memset in clear_if_addr
[project/netifd.git]
/
interface-ip.c
diff --git
a/interface-ip.c
b/interface-ip.c
index
587826a
..
8d4434b
100644
(file)
--- a/
interface-ip.c
+++ b/
interface-ip.c
@@
-75,8
+75,8
@@
clear_if_addr(union if_addr *a, int mask)
uint8_t m_clear = (1 << (m_bytes * 8 - mask)) - 1;
uint8_t *p = (uint8_t *) a;
uint8_t m_clear = (1 << (m_bytes * 8 - mask)) - 1;
uint8_t *p = (uint8_t *) a;
- if (m_bytes < sizeof(a))
- memset(p + m_bytes, 0, sizeof(a) - m_bytes);
+ if (m_bytes < sizeof(
*
a))
+ memset(p + m_bytes, 0, sizeof(
*
a) - m_bytes);
p[m_bytes - 1] &= ~m_clear;
}
p[m_bytes - 1] &= ~m_clear;
}