Fix pointer dereference before testing for NULL in rpmtdGetNumber()
This commit is contained in:
parent
8b1ea52de3
commit
c886b359ba
|
@ -210,12 +210,12 @@ const char * rpmtdGetString(rpmtd td)
|
|||
|
||||
uint64_t rpmtdGetNumber(rpmtd td)
|
||||
{
|
||||
uint64_t val = 0;
|
||||
int ix = (td->ix >= 0 ? td->ix : 0);
|
||||
|
||||
if (td == NULL)
|
||||
return 0;
|
||||
|
||||
uint64_t val = 0;
|
||||
int ix = (td->ix >= 0 ? td->ix : 0);
|
||||
|
||||
switch (td->type) {
|
||||
case RPM_INT64_TYPE:
|
||||
val = *((uint64_t *) td->data + ix);
|
||||
|
|
Loading…
Reference in New Issue