View Issue Details

IDProjectCategoryView StatusLast Update
0008043GNUnetutil librarypublic2024-03-07 20:26
Reporterfefe Assigned ToChristian Grothoff  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Fixed in Version0.21.0 
Summary0008043: GNUNET_JSON_from_data64: integer overflow
Description 52 json_t *
 53 GNUNET_JSON_from_data64 (const void *data,
 54 size_t size)
 55 {
 56 char *buf = NULL;
 57 json_t *json;
 58 size_t len;
 59
 60 if ((size * 8 + 5) / 6 + 1 >=
 61 GNUNET_MAX_MALLOC_CHECKED)
 62 {
 63 GNUNET_break (0);
 64 return NULL;
 65 }

If the caller was tricked and gives us an unreasonably big value for size, this arithmetic will overflow and we might clobber memory.
Additional InformationAll the arithmetic is basically superfluous anyway, since we compare to 10 MiB and not the largest possible value. We could just compare size directly to a different constant.
TagsNo tags attached.

Activities

Christian Grothoff

2024-01-09 19:16

manager   ~0020847

Fix committed to master branch.

schanzen

2024-03-07 20:26

administrator   ~0021803

0.21 released

Related Changesets

gnunet: master 1a82df7c

2024-01-09 20:16

Christian Grothoff


Details Diff
fix 0008043 Affected Issues
0008043
mod - src/lib/json/json_generator.c Diff File

Issue History

Date Modified Username Field Change
2024-01-09 12:25 fefe New Issue
2024-01-09 12:25 fefe Issue generated from: 0008042
2024-01-09 19:16 Christian Grothoff Changeset attached => gnunet master 1a82df7c
2024-01-09 19:16 Christian Grothoff Note Added: 0020847
2024-01-09 19:16 Christian Grothoff Assigned To => Christian Grothoff
2024-01-09 19:16 Christian Grothoff Status new => resolved
2024-01-09 19:16 Christian Grothoff Resolution open => fixed
2024-01-09 20:10 Christian Grothoff Project Taler => GNUnet
2024-01-09 20:10 Christian Grothoff Category other => util library
2024-03-07 20:26 schanzen Fixed in Version => 0.21.0
2024-03-07 20:26 schanzen Note Added: 0021803
2024-03-07 20:26 schanzen Status resolved => closed