projects
/
platform
/
upstream
/
rpm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0048c39
)
Tolerate NULL args in argvSplitString()
author
Panu Matilainen
<pmatilai@redhat.com>
Tue, 5 Oct 2010 06:11:13 +0000
(09:11 +0300)
committer
Panu Matilainen
<pmatilai@redhat.com>
Tue, 5 Oct 2010 06:11:52 +0000
(09:11 +0300)
rpmio/argv.c
patch
|
blob
|
history
diff --git
a/rpmio/argv.c
b/rpmio/argv.c
index
f21da1c
..
cf6e299
100644
(file)
--- a/
rpmio/argv.c
+++ b/
rpmio/argv.c
@@
-170,13
+170,17
@@
int argvAppend(ARGV_t * argvp, ARGV_const_t av)
ARGV_t argvSplitString(const char * str, const char * seps, argvFlags flags)
{
- char *dest =
xmalloc(strlen(str) + 1)
;
+ char *dest =
NULL
;
ARGV_t argv;
int argc = 1;
const char * s;
char * t;
int c;
+ if (str == NULL || seps == NULL)
+ return NULL;
+
+ dest = xmalloc(strlen(str) + 1);
for (argc = 1, s = str, t = dest; (c = *s); s++, t++) {
if (strchr(seps, c)) {
argc++;