projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
da3a7fd
)
strcpy to a NULL pointer is bad.
author
Alan T. DeKok
<aland@freeradius.org>
Mon, 2 Aug 2010 06:41:34 +0000
(08:41 +0200)
committer
Alan T. DeKok
<aland@freeradius.org>
Mon, 2 Aug 2010 13:31:28 +0000
(15:31 +0200)
Closes bug #98
src/lib/valuepair.c
patch
|
blob
|
history
diff --git
a/src/lib/valuepair.c
b/src/lib/valuepair.c
index
9b9e94c
..
efe37db
100644
(file)
--- a/
src/lib/valuepair.c
+++ b/
src/lib/valuepair.c
@@
-808,13
+808,11
@@
static int gettime(const char *valstr, time_t *date)
f[2] = strchr(f[1], ':'); /* find : separator */
if (f[2]) {
*(f[2]++) = '\0'; /* nuke it, and point to SS */
- } else {
- strcpy(f[2], "0"); /* assignment would discard const */
- }
+ tm->tm_sec = atoi(f[2]);
+ } /* else leave it as zero */
tm->tm_hour = atoi(f[0]);
tm->tm_min = atoi(f[1]);
- tm->tm_sec = atoi(f[2]);
}
/*