projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
0824dd5
)
Merge pull request #897 from spbnick/strlcpy_fix
author
Alan DeKok
<aland@freeradius.org>
Tue, 3 Feb 2015 13:32:49 +0000
(08:32 -0500)
committer
Alan DeKok
<aland@freeradius.org>
Tue, 3 Feb 2015 13:32:49 +0000
(08:32 -0500)
log: Check message buffer length to avoid overflow
src/main/log.c
patch
|
blob
|
history
diff --git
a/src/main/log.c
b/src/main/log.c
index
7470897
..
16d3faf
100644
(file)
--- a/
src/main/log.c
+++ b/
src/main/log.c
@@
-311,6
+311,8
@@
void radlog_request(int lvl, int priority, REQUEST *request, const char *msg, ..
if (len < sizeof(buffer)) {
len += strlcpy(buffer + len, fr_int2str(levels, (lvl & ~L_CONS), ": "), sizeof(buffer) - len);
+ if (len >= sizeof(buffer))
+ len = sizeof(buffer) - 1;
}
}