summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-08-14 15:02:52 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-08-14 15:02:52 +0300
commit77ecf321bfb1a2024cb5f6bc231a6b97c56373c6 (patch)
tree1b960a529bb4ade5dc00b343aa665e1f88939d68 /build
parent44263ec047b82f0989b6d9cb89393ee0ebe07f99 (diff)
downloadrpm-77ecf321bfb1a2024cb5f6bc231a6b97c56373c6.tar.gz
rpm-77ecf321bfb1a2024cb5f6bc231a6b97c56373c6.tar.bz2
rpm-77ecf321bfb1a2024cb5f6bc231a6b97c56373c6.zip
Fix segfault on zero-length %policy file
Diffstat (limited to 'build')
-rw-r--r--build/files.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/build/files.c b/build/files.c
index 697641dac..c9a788353 100644
--- a/build/files.c
+++ b/build/files.c
@@ -1585,7 +1585,7 @@ static rpmRC processMetadataFile(Package pkg, FileList fl,
break;
}
case RPMTAG_POLICIES:
- if ((xx = rpmioSlurp(fn, &pkt, &pktlen)) != 0) {
+ if ((xx = rpmioSlurp(fn, &pkt, &pktlen)) != 0 || pkt == NULL) {
rc = RPMRC_FAIL;
rpmlog(RPMLOG_ERR, _("%s: *.te policy read failed.\n"), fn);
goto exit;