summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-10-05 09:11:13 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-10-05 09:11:52 +0300
commit152d1f0bc4b3b99ca72d994f90fee0f91f627daf (patch)
tree7a54833f67d1ddcc4f25e692b5e2fe047960d368 /rpmio
parent0048c394797a903a693753e543337387db20e295 (diff)
downloadrpm-152d1f0bc4b3b99ca72d994f90fee0f91f627daf.tar.gz
Tolerate NULL args in argvSplitString()
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/argv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/rpmio/argv.c b/rpmio/argv.c
index f21da1c5d..cf6e2994e 100644
--- 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++;