projects
/
tools
/
librpm-tizen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ca7b28e
)
Fix potential buffer overflow by using dynamic buffer size.
author
Panu Matilainen
<pmatilai@redhat.com>
Mon, 27 Aug 2007 06:48:00 +0000
(09:48 +0300)
committer
Panu Matilainen
<pmatilai@redhat.com>
Mon, 27 Aug 2007 06:48:00 +0000
(09:48 +0300)
rpmio/macro.c
patch
|
blob
|
history
diff --git
a/rpmio/macro.c
b/rpmio/macro.c
index
52a7bc5
..
3c2070d
100644
(file)
--- a/
rpmio/macro.c
+++ b/
rpmio/macro.c
@@
-1080,7
+1080,10
@@
doOutput(MacroBuf mb, int waserror, const char * msg, size_t msglen)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/
/*@modifies mb, rpmGlobalMacroContext, fileSystem @*/
{
- char buf[BUFSIZ];
+ char *buf;
+
+ buf = alloca(msglen + 1);
+ memset(buf, 0, (msglen + 1));
strncpy(buf, msg, msglen);
buf[msglen] = '\0';