diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | URPM.xs | 8 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,5 @@ +- fix a segfault when callbacks don't get a header + Version 5.04 - 26 February 2015 - callbacks now get pkg name instead of just pkg id @@ -1314,8 +1314,12 @@ static void *rpmRunTransactions_callback(const void *arg, mPUSHs(newSViv(total)); } // for erasures, the key provided by librpm is always 0, so let's add another parameter (fullname): - char *s = headerGetAsString(h, RPMTAG_NVR); - mPUSHs(newSVpv(s, 0)); + if (h) { + char *s = headerGetAsString(h, RPMTAG_NVR); + mPUSHs(newSVpv(s, 0)); + } else { + PUSHs(&PL_sv_undef); + } PUTBACK; i = call_sv(callback, callback == td->callback_open ? G_SCALAR : G_DISCARD); SPAGAIN; |