projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46eca48
)
Use strlcpy rather than strncpy, and use the size of the output
author
aland
<aland>
Fri, 26 Jan 2007 09:39:19 +0000
(09:39 +0000)
committer
aland
<aland>
Fri, 26 Jan 2007 09:39:19 +0000
(09:39 +0000)
buffer rather than the size of the input buffer.
src/modules/rlm_perl/rlm_perl.c
patch
|
blob
|
history
diff --git
a/src/modules/rlm_perl/rlm_perl.c
b/src/modules/rlm_perl/rlm_perl.c
index
92752ed
..
92f3a5d
100644
(file)
--- a/
src/modules/rlm_perl/rlm_perl.c
+++ b/
src/modules/rlm_perl/rlm_perl.c
@@
-679,8
+679,8
@@
static int perl_xlat(void *instance, REQUEST *request, char *fmt, char * out,
POPs ;
} else if (count > 0) {
tmp = POPp;
-
ret = strlen(tmp
);
-
strncpy(out,tmp,re
t);
+
strlcpy(out, tmp, freespace
);
+
ret = strlen(ou
t);
radlog(L_DBG,"rlm_perl: Len is %d , out is %s freespace is %d",
ret, out,freespace);