summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-05-05 11:53:48 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-05-05 11:53:48 +0300
commit3e991bc40c4f7818d720649901993cec95056540 (patch)
tree356a359c4d7fdc9c0f38c5a48b24c9b0d1953a40 /build
parent39168e47aba5c953ecd3bde7134c577b31871bf9 (diff)
downloadlibrpm-tizen-3e991bc40c4f7818d720649901993cec95056540.tar.gz
librpm-tizen-3e991bc40c4f7818d720649901993cec95056540.tar.bz2
librpm-tizen-3e991bc40c4f7818d720649901993cec95056540.zip
Eliminate static sized string buffer in parseScript()
Diffstat (limited to 'build')
-rw-r--r--build/parseScript.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/build/parseScript.c b/build/parseScript.c
index 3e73b52bd..a2e6764b5 100644
--- a/build/parseScript.c
+++ b/build/parseScript.c
@@ -86,7 +86,7 @@ int parseScript(rpmSpec spec, int parsePart)
StringBuf sb = NULL;
int nextPart;
int index;
- char reqargs[BUFSIZ];
+ char * reqargs = NULL;
int res = PART_ERROR; /* assume failure */
int rc, argc;
@@ -94,7 +94,6 @@ int parseScript(rpmSpec spec, int parsePart)
const char **argv = NULL;
poptContext optCon = NULL;
- reqargs[0] = '\0';
name = NULL;
prog = "/bin/sh";
file = NULL;
@@ -182,13 +181,13 @@ int parseScript(rpmSpec spec, int parsePart)
}
*p = '\0';
- strcpy(reqargs, p + 2);
+ reqargs = xstrdup(p + 2);
}
if ((rc = poptParseArgvString(spec->line, &argc, &argv))) {
rpmlog(RPMLOG_ERR, _("line %d: Error parsing %s: %s\n"),
spec->lineNum, partname, poptStrerror(rc));
- return PART_ERROR;
+ goto exit;
}
optCon = poptGetContext(NULL, argc, argv, optionsTable, 0);
@@ -345,6 +344,7 @@ int parseScript(rpmSpec spec, int parsePart)
res = nextPart;
exit:
+ free(reqargs);
sb = freeStringBuf(sb);
progArgv = _free(progArgv);
argv = _free(argv);