aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2011-05-05 01:58:09 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2011-05-05 01:58:09 +0000
commit45177ad6977c42110e71fa6b1ae612fefaef7549 (patch)
tree6402a27d174b5637933e5cc28d60ff38a1b83d08
parentd03f11065ce14b9868d3bdcb62673118488420ee (diff)
downloadperl-URPM-45177ad6977c42110e71fa6b1ae612fefaef7549.tar
perl-URPM-45177ad6977c42110e71fa6b1ae612fefaef7549.tar.gz
perl-URPM-45177ad6977c42110e71fa6b1ae612fefaef7549.tar.bz2
perl-URPM-45177ad6977c42110e71fa6b1ae612fefaef7549.tar.xz
perl-URPM-45177ad6977c42110e71fa6b1ae612fefaef7549.zip
fix an invalid free() that would've happened if package summary were to be missing and the "" string constant were attempted to be freed
-rw-r--r--NEWS2
-rw-r--r--URPM.xs2
2 files changed, 3 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 37fd950..ab70f8c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
Version 4.28 - May 2011, by Per Øyvind Karlsen
+- fix an invalid free() that would've happened if package summary were to be
+ missing and the "" string constant were attempted to be freed
- fix odd problems caused by attempt at translating correct tag names for
query table into rpm tags
- use newSVpvs() for pushing empty strings as constants in stead
diff --git a/URPM.xs b/URPM.xs
index 9200c05..789e950 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -1048,7 +1048,7 @@ pack_header(URPM__Package pkg) {
pkg->provides = pack_list(pkg->h, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDEVERSION, NULL);
if (pkg->summary == NULL) {
const char *summary = get_name(pkg->h, RPMTAG_SUMMARY);
- pkg->summary = summary ? (char*)summary : "";
+ pkg->summary = summary ? (char*)summary : strdup("");
}
if (!(pkg->flag & FLAG_NO_HEADER_FREE)) pkg->h =headerFree(pkg->h);