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:
aabf8d5
)
Fix off-by one in urlOpen()
author
Jindrich Novy
<jnovy@redhat.com>
Tue, 1 Apr 2008 14:37:42 +0000
(16:37 +0200)
committer
Jindrich Novy
<jnovy@redhat.com>
Tue, 1 Apr 2008 14:40:15 +0000
(16:40 +0200)
- the former implementation didn't take the ending '\0' into account
rpmio/rpmio.c
patch
|
blob
|
history
diff --git
a/rpmio/rpmio.c
b/rpmio/rpmio.c
index
4e4de81
..
39e0669
100644
(file)
--- a/
rpmio/rpmio.c
+++ b/
rpmio/rpmio.c
@@
-783,8
+783,7
@@
static FD_t urlOpen(const char * url, int flags, mode_t mode)
dest = rpmGenPath(NULL, "%{_tmppath}/", "rpm-transfer.XXXXXX");
close(mkstemp(dest));
- cmd = xmalloc(strlen(urlhelper) + strlen(dest) + strlen(url) + 3);
- sprintf(cmd, "%s %s %s\n", urlhelper, dest, url);
+ rasprintf(&cmd, "%s %s %s\n", urlhelper, dest, url);
urlhelper = _free(urlhelper);
if ((pid = fork()) == 0) {