projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac7a809
)
Fix for coverity (printf of non null terminated string)
author
Arran Cudbard-Bell
<a.cudbardb@freeradius.org>
Sun, 17 Feb 2013 19:40:56 +0000
(14:40 -0500)
committer
Arran Cudbard-Bell
<a.cudbardb@freeradius.org>
Sun, 17 Feb 2013 19:41:20 +0000
(14:41 -0500)
src/main/radwho.c
patch
|
blob
|
history
diff --git
a/src/main/radwho.c
b/src/main/radwho.c
index
18e701a
..
4115e12
100644
(file)
--- a/
src/main/radwho.c
+++ b/
src/main/radwho.c
@@
-487,7
+487,7
@@
int main(int argc, char **argv)
*/
while (fread(&rt, sizeof(rt), 1, fp) == 1) {
if (rt.type != P_LOGIN) continue; /* hide logout sessions */
-
+
/*
* We don't show shell users if we are
* fingerd, as we have done that above.
@@
-600,8
+600,11
@@
int main(int argc, char **argv)
* Show the fill name, or not.
*/
if (showname) {
+ char login[sizeof(rt.login) + 1];
+ strncpy(login, rt.login, sizeof(rt.login));
+
printf((rawoutput == 0? rfmt1: rfmt1r),
-
rt.
login,
+ login,
showcid ? rt.caller_id :
(showsid? session_id : fullname(rt.login)),
proto(rt.proto, rt.porttype),