Always initialize hdrp retval of rpmReadPackageFile()

Since commit 3ccd9ccf50, hdrp has only
been set on success (at least half-intentionally), but turns out a
various third party software depends on the former behavior. And on
closer inspection, it's actually a documented feature of the API.
This commit is contained in:
Panu Matilainen 2017-10-04 10:15:28 +03:00
parent f064492a50
commit 73c76f5999
1 changed files with 4 additions and 0 deletions

View File

@ -298,6 +298,10 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp)
.fn = fn ? fn : Fdescr(fd),
};
/* XXX: lots of 3rd party software relies on the behavior */
if (hdrp)
*hdrp = NULL;
rpmRC rc = rpmpkgRead(keyring, vsflags, fd, handlePkgVS, &pkgdata, hdrp);
rpmKeyringFree(keyring);