librazor/rpm.c
changeset 316 5ebed314390c
parent 289 dc69c55cf462
child 322 66c281524c98
     1.1 --- a/librazor/rpm.c	Thu Jun 26 18:15:59 2008 -0400
     1.2 +++ b/librazor/rpm.c	Tue Jul 08 22:02:58 2008 -0400
     1.3 @@ -31,6 +31,7 @@
     1.4  #include <unistd.h>
     1.5  #include <arpa/inet.h>
     1.6  #include <zlib.h>
     1.7 +#include <assert.h>
     1.8  
     1.9  #include "razor.h"
    1.10  #include "razor-internal.h"
    1.11 @@ -357,6 +358,8 @@
    1.12  	const char *name;
    1.13  	int fd;
    1.14  
    1.15 +	assert (filename != NULL);
    1.16 +
    1.17  	rpm = malloc(sizeof *rpm);
    1.18  	if (rpm == NULL)
    1.19  		return NULL;
    1.20 @@ -713,6 +716,9 @@
    1.21  	char *path;
    1.22  	size_t filesize;
    1.23  
    1.24 +	assert (rpm != NULL);
    1.25 +	assert (root != NULL);
    1.26 +
    1.27  	installer.rpm = rpm;
    1.28  	installer.root = root;
    1.29  
    1.30 @@ -771,6 +777,8 @@
    1.31  {
    1.32  	int err;
    1.33  
    1.34 +	assert (rpm != NULL);
    1.35 +
    1.36  	free(rpm->dirs);
    1.37  	err = munmap(rpm->map, rpm->size);
    1.38  	free(rpm);
    1.39 @@ -786,6 +794,9 @@
    1.40  	const uint32_t *epoch;
    1.41  	char evr[128], buf[16];
    1.42  
    1.43 +	assert (importer != NULL);
    1.44 +	assert (rpm != NULL);
    1.45 +
    1.46  	name = razor_rpm_get_indirect(rpm, RPMTAG_NAME, NULL);
    1.47  	epoch = razor_rpm_get_indirect(rpm, RPMTAG_EPOCH, NULL);
    1.48  	version = razor_rpm_get_indirect(rpm, RPMTAG_VERSION, NULL);