diff options
-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) { |