projects
/
platform
/
upstream
/
rpm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cec0014
)
Handle NULL header in doHeaderUnload()
author
Panu Matilainen
<pmatilai@redhat.com>
Wed, 9 Sep 2009 09:17:10 +0000
(12:17 +0300)
committer
Panu Matilainen
<pmatilai@redhat.com>
Wed, 9 Sep 2009 09:17:10 +0000
(12:17 +0300)
- avoids having to separately check elsewhere and avoids segfaulting
on headerUnload() and headerReload() on NULL headers
lib/header.c
patch
|
blob
|
history
diff --git
a/lib/header.c
b/lib/header.c
index
45bbc2d
..
c4cc78e
100644
(file)
--- a/
lib/header.c
+++ b/
lib/header.c
@@
-456,6
+456,8
@@
static void * doHeaderUnload(Header h,
int i;
int drlen, ndribbles;
+ if (h == NULL) return NULL;
+
/* Sort entries by (offset,tag). */
headerUnsort(h);
@@
-1013,8
+1015,6
@@
int headerWrite(FD_t fd, Header h, enum hMagic magicp)
size_t length;
void * uh;
- if (h == NULL)
- return 1;
uh = doHeaderUnload(h, &length);
if (uh == NULL)
return 1;