aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
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 /URPM.xs
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)
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs2
1 files changed, 2 insertions, 0 deletions
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) {