From 45177ad6977c42110e71fa6b1ae612fefaef7549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Thu, 5 May 2011 01:58:09 +0000 Subject: fix an invalid free() that would've happened if package summary were to be missing and the "" string constant were attempted to be freed --- NEWS | 2 ++ URPM.xs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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); -- cgit v1.2.1