diff options
author | Jindrich Novy <jnovy@redhat.com> | 2008-04-29 16:08:19 +0200 |
---|---|---|
committer | Jindrich Novy <jnovy@redhat.com> | 2008-04-29 16:08:19 +0200 |
commit | 586268cc94edf8dd8af5668f3c9000d02facf57b (patch) | |
tree | 1740ff0a2c03673045e72fb55b737a172dd272a4 | |
parent | f05198ca5ec06fe48805b55ec51ef600612804cf (diff) | |
download | rpm-586268cc94edf8dd8af5668f3c9000d02facf57b.tar.gz rpm-586268cc94edf8dd8af5668f3c9000d02facf57b.tar.bz2 rpm-586268cc94edf8dd8af5668f3c9000d02facf57b.zip |
Don't use alloca in rpmGenPath()
-rw-r--r-- | rpmio/rpmfileutil.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rpmio/rpmfileutil.c b/rpmio/rpmfileutil.c index 49a432361..64510e991 100644 --- a/rpmio/rpmfileutil.c +++ b/rpmio/rpmfileutil.c @@ -485,17 +485,18 @@ char * rpmGenPath(const char * urlroot, const char * urlmdir, } if (url && nurl > 0) { - char *t = strncpy(alloca(nurl+1), url, nurl); + char *t = rstrcat(NULL, url); t[nurl] = '\0'; url = t; } else - url = ""; + url = xstrdup(""); result = rpmGetPath(url, root, "/", mdir, "/", file, NULL); xroot = _free(xroot); xmdir = _free(xmdir); xfile = _free(xfile); + _constfree(url); return result; } |