projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0495f31
)
Replace strncat() with strlcpy()
author
Alan T. DeKok
<aland@freeradius.org>
Sun, 1 Feb 2015 22:24:23 +0000
(17:24 -0500)
committer
Alan T. DeKok
<aland@freeradius.org>
Sun, 1 Feb 2015 22:24:23 +0000
(17:24 -0500)
src/main/log.c
patch
|
blob
|
history
diff --git
a/src/main/log.c
b/src/main/log.c
index
f36c04e
..
7470897
100644
(file)
--- a/
src/main/log.c
+++ b/
src/main/log.c
@@
-307,10
+307,10
@@
void radlog_request(int lvl, int priority, REQUEST *request, const char *msg, ..
s[1] = '\0';
}
+ len = strlen(buffer);
+
if (len < sizeof(buffer)) {
- strncat(buffer, fr_int2str(levels, (lvl & ~L_CONS), ": "),
- sizeof(buffer) - len - 1);
- len = strlen(buffer);
+ len += strlcpy(buffer + len, fr_int2str(levels, (lvl & ~L_CONS), ": "), sizeof(buffer) - len);
}
}