diff options
author | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2010-12-10 23:46:42 +0000 |
---|---|---|
committer | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2010-12-10 23:46:42 +0000 |
commit | b0593f3b41397f1cceda89eaf1a1a7cd0c827a87 (patch) | |
tree | 1e3eec6681c5f90cb657089fd31b95d3edef876b | |
parent | e849a73b591943ef32be37a0b2cb7247d206c188 (diff) | |
download | perl-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.xs | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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) { |