projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c84165
)
Invoking stat -c FMT with a lone format directive of %s, %f, %h, %s,
author
Jim Meyering
<jim@meyering.net>
Sat, 12 Mar 2005 10:54:20 +0000
(10:54 +0000)
committer
Jim Meyering
<jim@meyering.net>
Sat, 12 Mar 2005 10:54:20 +0000
(10:54 +0000)
could cause a buffer overrun error.
(print_it): Allocate 2 more bytes, to accommodate our
conversion of the stat %s format string to the longer printf %llu one.
Patch from Guochun Shi.
src/stat.c
patch
|
blob
|
history
diff --git
a/src/stat.c
b/src/stat.c
index f9f145918900f03353b870a0d7fae95e98a685f6..2f4609c9023de9fd35f00139f3999ab368c1986c 100644
(file)
--- a/
src/stat.c
+++ b/
src/stat.c
@@
-534,7
+534,7
@@
print_it (char const *masterformat, char const *filename,
/* create a working copy of the format string */
char *format = xstrdup (masterformat);
- char *dest = xmalloc (strlen (format) + 1);
+ char *dest = xmalloc (strlen (format) +
2 +
1);
b = format;
while (b)