diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-03-19 19:17:31 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-03-19 19:17:31 +0100 |
commit | 9c6827519c6fd93265c6b556ec847628c7e28634 (patch) | |
tree | 298d040ff63ab363bedd3c00b3bb14138aa4f197 /src/lib/sync_api_download.c | |
parent | 78d33aa6bda6afccaf56fc3a302681ca0df2256e (diff) | |
download | sync-9c6827519c6fd93265c6b556ec847628c7e28634.tar.gz sync-9c6827519c6fd93265c6b556ec847628c7e28634.tar.bz2 sync-9c6827519c6fd93265c6b556ec847628c7e28634.zip |
conservatively use strtok_r
Diffstat (limited to 'src/lib/sync_api_download.c')
-rw-r--r-- | src/lib/sync_api_download.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/sync_api_download.c b/src/lib/sync_api_download.c index 719c1dc..f381075 100644 --- a/src/lib/sync_api_download.c +++ b/src/lib/sync_api_download.c @@ -192,18 +192,21 @@ handle_header (char *buffer, char *ndup; const char *hdr_type; char *hdr_val; + char *sp; ndup = GNUNET_strndup (buffer, total); - hdr_type = strtok (ndup, - ":"); + hdr_type = strtok_r (ndup, + ":", + &sp); if (NULL == hdr_type) { GNUNET_free (ndup); return total; } - hdr_val = strtok (NULL, - "\n\r"); + hdr_val = strtok_r (NULL, + "\n\r", + &sp); if (NULL == hdr_val) { GNUNET_free (ndup); |