View Issue Details

IDProjectCategoryView StatusLast Update
0008042GNUnetutil librarypublic2024-03-07 19:26
Reporterfefe Assigned ToChristian Grothoff Due Date
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Fixed in Version0.21.0 
Summary0008042: GNUNET_JSON_from_data: integer overflow
Description 30 json_t *
 31 GNUNET_JSON_from_data (const void *data,
 32 size_t size)
 33 {
 34 char *buf;
 35 json_t *json;
 36
 37 if ((size * 8 + 4) / 5 + 1 >=
 38 GNUNET_MAX_MALLOC_CHECKED)

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 18:18

manager   ~0020848

Fixed by changing arithmetic to compare to constant.

schanzen

2024-03-07 19:26

administrator   ~0021804

0.21 released

Issue History

Date ModifiedUsernameFieldChange
2024-01-09 11:23fefeNew Issue
2024-01-09 11:25fefeIssue cloned: 0008043
2024-01-09 18:18Christian GrothoffAssigned To => Christian Grothoff
2024-01-09 18:18Christian GrothoffStatusnew => resolved
2024-01-09 18:18Christian GrothoffResolutionopen => fixed
2024-01-09 18:18Christian GrothoffNote Added: 0020848
2024-01-09 19:10Christian GrothoffProjectTaler => GNUnet
2024-01-09 19:10Christian GrothoffCategoryother => util library
2024-03-07 19:26schanzenFixed in Version => 0.21.0
2024-03-07 19:26schanzenNote Added: 0021804
2024-03-07 19:26schanzenStatusresolved => closed