projects
/
platform
/
upstream
/
toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
94fdf49
)
Don't write a zero past end of toybuf with large -d value.
author
Rob Landley
<rob@landley.net>
Mon, 9 Sep 2013 11:50:00 +0000
(06:50 -0500)
committer
Rob Landley
<rob@landley.net>
Mon, 9 Sep 2013 11:50:00 +0000
(06:50 -0500)
toys/posix/touch.c
patch
|
blob
|
history
diff --git
a/toys/posix/touch.c
b/toys/posix/touch.c
index
3a65e93
..
4d46a16
100644
(file)
--- a/
toys/posix/touch.c
+++ b/
toys/posix/touch.c
@@
-72,6
+72,7
@@
void touch_main(void)
putenv("TZ=UTC");
strncpy(toybuf, date, sizeof(toybuf)-1);
date = toybuf;
+ if (i > sizeof(toybuf)-1) i = sizeof(toybuf)-1;
date[i]=0;
gmtime_r(&(tv->tv_sec), &tm);
}