View Issue Details

IDProjectCategoryView StatusLast Update
0008104Talerexchangepublic2024-03-07 20:47
Reporterfefe Assigned ToChristian Grothoff  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Target Version0.9.4Fixed in Version0.9.4 
Summary0008104: parse_json_denomkey_partially: memory leak?
DescriptionThis is in exchange/src/lib/exchange_api_handle.c:

 520 /* invalidate denom_key, just to be sure */
 521 memset (denom_key,
 522 0,
 523 sizeof (*denom_key));
 524 GNUNET_JSON_parse_free (spec);
 525 return GNUNET_SYSERR;
 526 }

denom_key contains an embedded pointer:

 460 struct TALER_EXCHANGE_DenomPublicKey *denom_key,

  71 struct TALER_EXCHANGE_DenomPublicKey
  72 {
  73 /**
  74 * The public key
  75 */
  76 struct TALER_DenominationPublicKey key;

1229 struct TALER_DenominationPublicKey
1230 {
1231
1232 /**
1233 * Age restriction mask used for the key.
1234 */
1235 struct TALER_AgeMask age_mask;
1236
1237 /**
1238 * Type of the public key.
1239 */
1240 struct GNUNET_CRYPTO_BlindSignPublicKey *bsign_pub_key;
1241
1242 };

If I read the code right, this public key came out of the json parser.
I think if you just memset the struct here, you leak the memory of the key.
TagsNo tags attached.

Relationships

child of 0008112 assignedfefe Merchant security review 

Activities

Christian Grothoff

2024-01-18 22:33

manager   ~0020912

Indeed, nice catch. Fixed in 53e679c9..c8126ffc

Issue History

Date Modified Username Field Change
2024-01-18 14:33 fefe New Issue
2024-01-18 14:33 fefe Status new => assigned
2024-01-18 14:33 fefe Assigned To => Christian Grothoff
2024-01-18 22:33 Christian Grothoff Status assigned => resolved
2024-01-18 22:33 Christian Grothoff Resolution open => fixed
2024-01-18 22:33 Christian Grothoff Fixed in Version => 0.9.4
2024-01-18 22:33 Christian Grothoff Note Added: 0020912
2024-01-18 22:33 Christian Grothoff Target Version => 0.9.4
2024-01-18 23:30 Christian Grothoff Relationship added child of 0008112
2024-03-07 20:47 Christian Grothoff Status resolved => closed