View Issue Details

IDProjectCategoryView StatusLast Update
0009637GNUnetARM servicepublic2025-04-11 12:43
Reporterfefe Assigned ToChristian Grothoff Due Date
PrioritynormalSeverityminorReproducibilityunable to reproduce
Status closedResolutionfixed 
Product VersionGit master 
Target Version0.24.1Fixed in Version0.24.1 
Summary0009637: process_refunds_cb: can prd->cr_head be NULL?
DescriptionThe case is handled by the for loop:

  503 for (cr = prd->cr_head;
  504 NULL != cr;
  505 cr = cr->next)
  506 if (cr->refund_serial == refund_serial)
  507 return;

but further down we just dereference cr_head->prev:

  523 GNUNET_CONTAINER_DLL_insert (prd->cr_head,
  524 prd->cr_tail,
  525 cr);
TagsNo tags attached.

Activities

Christian Grothoff

2025-03-19 01:11

manager   ~0024241

Nope, we don't. You're reading the macro wrong. It checks if cr_head is NULL. Our DLLs always work like that, basically head/tail start out as NULL, that's totally normal for that macro.

fefe

2025-03-19 09:23

reporter   ~0024242

I analyzed the issue a bit more.
This confused the static analyzer because it does not understand that head and tail are NULL at the same time.
You check whether tail is NULL and then dereference head->prev.
Adding an assertion that either both or none of head and tail are NULL would fix this.

Christian Grothoff

2025-03-19 11:25

manager   ~0024243

Fixed in GNUnet via 611583c70..db8b6c7a5.

schanzen

2025-04-11 12:43

administrator   ~0024510

0.24.1

Issue History

Date ModifiedUsernameFieldChange
2025-03-18 13:51fefeNew Issue
2025-03-18 13:51fefeStatusnew => assigned
2025-03-18 13:51fefeAssigned To => Christian Grothoff
2025-03-19 01:11Christian GrothoffNote Added: 0024241
2025-03-19 01:11Christian GrothoffStatusassigned => resolved
2025-03-19 01:11Christian GrothoffResolutionopen => no change required
2025-03-19 01:11Christian GrothoffFixed in Version => 1.0
2025-03-19 01:11Christian GrothoffReproducibilityhave not tried => unable to reproduce
2025-03-19 01:11Christian GrothoffProduct Version => git (master)
2025-03-19 01:11Christian GrothoffTarget Version => 1.0
2025-03-19 09:23fefeStatusresolved => feedback
2025-03-19 09:23fefeResolutionno change required => reopened
2025-03-19 09:23fefeNote Added: 0024242
2025-03-19 11:25Christian GrothoffNote Added: 0024243
2025-03-19 11:25Christian GrothoffStatusfeedback => resolved
2025-03-19 11:25Christian GrothoffResolutionreopened => fixed
2025-03-19 11:25Christian GrothoffProjectTaler => GNUnet
2025-03-19 11:25Christian GrothoffCategorymechant backend => General
2025-03-19 11:26Christian GrothoffCategoryGeneral => ARM service
2025-03-19 11:26Christian GrothoffProduct Versiongit (master) => Git master
2025-03-19 11:26Christian GrothoffFixed in Version1.0 => 0.25.0
2025-03-19 11:26Christian GrothoffTarget Version1.0 => 0.25.0
2025-03-20 18:43schanzenTarget Version0.25.0 => 0.24.1
2025-04-11 12:32schanzenFixed in Version0.25.0 => 0.24.1
2025-04-11 12:43schanzenNote Added: 0024510
2025-04-11 12:43schanzenStatusresolved => closed