fix possible NULL deref, simplify logic
This commit is contained in:
parent
b53c189e0a
commit
783642272d
@ -476,21 +476,16 @@ handle_history (struct TALER_FAKEBANK_Handle *h,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (NULL == h->transactions_head)
|
for (pos = h->transactions_head;
|
||||||
|
NULL != pos;
|
||||||
|
pos = pos->next)
|
||||||
|
if (pos->serial_id == start_number)
|
||||||
|
break;
|
||||||
|
if (NULL == pos)
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
return MHD_NO;
|
return MHD_NO;
|
||||||
}
|
}
|
||||||
for (pos = h->transactions_head;
|
|
||||||
pos->serial_id != start_number;
|
|
||||||
pos = pos->next)
|
|
||||||
{
|
|
||||||
if (NULL == pos)
|
|
||||||
{
|
|
||||||
GNUNET_break (0);
|
|
||||||
return MHD_NO;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* range is exclusive, skip the matching entry */
|
/* range is exclusive, skip the matching entry */
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
pos = pos->next;
|
pos = pos->next;
|
||||||
|
Loading…
Reference in New Issue
Block a user