aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-06-14 18:23:44 +0000
committerThierry Vignaud <tv@mageia.org>2012-06-14 18:23:44 +0000
commita7c1739c95b0b2f9ef189b0fd80b296a377eea04 (patch)
tree659abb52a74f554dece9ba5a4c2f26d880d843a2
parent25a54f906d78de9069ece2af21dca9c0a43fe48e (diff)
downloadperl-URPM-a7c1739c95b0b2f9ef189b0fd80b296a377eea04.tar
perl-URPM-a7c1739c95b0b2f9ef189b0fd80b296a377eea04.tar.gz
perl-URPM-a7c1739c95b0b2f9ef189b0fd80b296a377eea04.tar.bz2
perl-URPM-a7c1739c95b0b2f9ef189b0fd80b296a377eea04.tar.xz
perl-URPM-a7c1739c95b0b2f9ef189b0fd80b296a377eea04.zip
(get_fullname_parts) fix a very old segfault in unused code
rationale: .info is set only if filled by pack_header() from header tags or by parse_line() (from a synthesis)
-rw-r--r--NEWS2
-rw-r--r--URPM.xs2
2 files changed, 4 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index b977307..4e50d34 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- fix a very old segfault in unused code
+
Version 4.2 - 13 June 2012
- clean DB API (needs a new urpmi)
diff --git a/URPM.xs b/URPM.xs
index a30b98d..289e26a 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -127,6 +127,8 @@ static void
get_fullname_parts(URPM__Package pkg, char **name, char **version, char **release, char **arch, char **eos) {
char *_version = NULL, *_release = NULL, *_arch = NULL, *_eos = NULL;
+ if (!pkg->info)
+ return;
if ((_eos = strchr(pkg->info, '@')) != NULL) {
*_eos = 0; /* mark end of string to enable searching backwards */
if ((_arch = strrchr(pkg->info, '.')) != NULL) {