View Issue Details

IDProjectCategoryView StatusLast Update
0006146Talerexchangepublic2021-09-02 18:14
Reporterfefe Assigned ToChristian Grothoff  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version0.7.0 
Target Version0.7.1Fixed in Version0.7.1 
Summary0006146: Taler exchange is multithreaded yet uses GNUNET_STRINGS_absolute_time_to_string
DescriptionGNUNET_STRINGS_absolute_time_to_string is not thread-safe. It returns a pointer to a static buffer, which is the same for all callers.
So if two threads call it simultaneously, the two callers will clobber each other's output into the buffer and return a garbled value.

Recommendation: add a GNUNET_STRINGS_absolute_time_to_string_r function that additionally takes a buffer and a buffer size as arguments.
Steps To Reproducegnunet-0.12.2/src/util/strings.c

 741 const char *
 742 GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t)
 743 {
 744 static char buf[255];

 759 return buf;
 760 }
TagsNo tags attached.

Activities

Christian Grothoff

2020-04-02 11:40

manager   ~0015489

Fixed in a4653a7a0..225ddf0a2 (gnunet.git) and d1bf2692..340ac361 (exchange.git) by adding missing GNUNET_THREAD_LOCAL for routines with such static buffers.

Christian Grothoff

2021-09-02 18:14

manager   ~0018269

Fix committed to master branch.

Related Changesets

exchange: master 340ac361

2020-04-02 13:34

Christian Grothoff


Details Diff
fix 0006146 Affected Issues
0006146
mod - src/util/amount.c Diff File
mod - src/util/util.c Diff File

Issue History

Date Modified Username Field Change
2020-04-02 11:27 fefe New Issue
2020-04-02 11:27 fefe Status new => assigned
2020-04-02 11:27 fefe Assigned To => Christian Grothoff
2020-04-02 11:40 Christian Grothoff Note Added: 0015489
2020-04-02 11:40 Christian Grothoff Status assigned => resolved
2020-04-02 11:40 Christian Grothoff Resolution open => fixed
2020-04-02 11:40 Christian Grothoff Fixed in Version => 0.7.1
2020-04-02 11:40 Christian Grothoff Target Version => 0.7.1
2021-08-24 16:23 Christian Grothoff Status resolved => closed
2021-09-02 18:13 Christian Grothoff Changeset attached => Taler-exchange master 340ac361
2021-09-02 18:14 Christian Grothoff Note Added: 0018269