projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2761071
)
Check for memset of zero
author
Alan T. DeKok
<aland@freeradius.org>
Thu, 6 Sep 2012 09:22:24 +0000
(11:22 +0200)
committer
Alan T. DeKok
<aland@freeradius.org>
Thu, 6 Sep 2012 09:33:18 +0000
(11:33 +0200)
src/lib/radius.c
patch
|
blob
|
history
diff --git
a/src/lib/radius.c
b/src/lib/radius.c
index
cb412c4
..
7c5a437
100644
(file)
--- a/
src/lib/radius.c
+++ b/
src/lib/radius.c
@@
-514,7
+514,7
@@
static void make_passwd(uint8_t *output, size_t *outlen,
if (len > MAX_PASS_LEN) len = MAX_PASS_LEN;
memcpy(passwd, input, len);
- memset(passwd + len, 0, sizeof(passwd) - len);
+
if (len < sizeof(passwd))
memset(passwd + len, 0, sizeof(passwd) - len);
if (len == 0) {
len = AUTH_PASS_LEN;