diff options
author | Kristian Høgsberg <krh@redhat.com> | 2008-06-19 15:09:48 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2008-06-19 15:09:48 -0400 |
commit | 157b904acee4209f6555550768edf1e150046146 (patch) | |
tree | 8fcd11c4e942c2fb092a81dc376c93fb2a1a1bab /librazor | |
parent | c646549b9b19d89de74b0af01b1ad2e92ee2e6e3 (diff) |
Handle NULL dirnames when importing rpms into a set.
Diffstat (limited to 'librazor')
-rw-r--r-- | librazor/rpm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/librazor/rpm.c b/librazor/rpm.c index c87de7f..af7c5ae 100644 --- a/librazor/rpm.c +++ b/librazor/rpm.c @@ -322,8 +322,10 @@ import_files(struct razor_importer *importer, struct razor_rpm *rpm) unsigned int i, count; char buffer[256]; - /* assert: count is the same for all arrays */ + if (rpm->dirs == NULL) + return; + /* assert: count is the same for all arrays */ index = razor_rpm_get_indirect(rpm, RPMTAG_DIRINDEXES, &count); name = razor_rpm_get_indirect(rpm, RPMTAG_BASENAMES, &count); for (i = 0; i < count; i++) { @@ -346,6 +348,8 @@ razor_rpm_open(const char *filename) int fd; rpm = malloc(sizeof *rpm); + if (rpm == NULL) + return NULL; memset(rpm, 0, sizeof *rpm); fd = open(filename, O_RDONLY); |