aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2010-12-10 23:46:42 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2010-12-10 23:46:42 +0000
commitb0593f3b41397f1cceda89eaf1a1a7cd0c827a87 (patch)
tree1e3eec6681c5f90cb657089fd31b95d3edef876b
parente849a73b591943ef32be37a0b2cb7247d206c188 (diff)
downloadperl-URPM-b0593f3b41397f1cceda89eaf1a1a7cd0c827a87.tar
perl-URPM-b0593f3b41397f1cceda89eaf1a1a7cd0c827a87.tar.gz
perl-URPM-b0593f3b41397f1cceda89eaf1a1a7cd0c827a87.tar.bz2
perl-URPM-b0593f3b41397f1cceda89eaf1a1a7cd0c827a87.tar.xz
perl-URPM-b0593f3b41397f1cceda89eaf1a1a7cd0c827a87.zip
check return value of tmp before doing operations on it..
-rw-r--r--URPM.xs9
1 files changed, 5 insertions, 4 deletions
diff --git a/URPM.xs b/URPM.xs
index f0d8357..d2a45aa 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -291,10 +291,11 @@ get_fullname_parts(URPM__Package pkg, char **name, int *epoch, char **version, c
if (arch != NULL) *arch = pubkey ? "" : _arch + 1;
if (distepoch != NULL || disttag != NULL || release != NULL || version != NULL || name != NULL) {
if((_distepoch = strchr(strrchr(pkg->provides, '-'), ':')) != NULL) {
- tmp = strrchr(_distepoch+1, ']');
- backup_char(tmp);
- tmp = strstr(pkg->info, _distepoch+1);
- backup_char(tmp);
+ if((tmp = strrchr(_distepoch+1, ']'))) {
+ backup_char(tmp);
+ if((tmp = strstr(pkg->info, _distepoch+1)))
+ backup_char(tmp);
+ }
}
if(distepoch != NULL) *distepoch = _distepoch ? _distepoch+1 : NULL;
if (disttag != NULL || release != NULL || version != NULL || name != NULL) {