aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_getopt.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-07-08 17:20:23 +0000
committerChristian Grothoff <christian@grothoff.org>2016-07-08 17:20:23 +0000
commitd8c53b12a818ff7cf82d06a1a69c395bdef85ee6 (patch)
tree0ebb0db416c157fcfde51a941185819dd12d51fd /src/fs/fs_getopt.c
parent5184c17d32a39c928c2a0fec3ee1ad098bbaa562 (diff)
downloadgnunet-d8c53b12a818ff7cf82d06a1a69c395bdef85ee6.tar.gz
gnunet-d8c53b12a818ff7cf82d06a1a69c395bdef85ee6.zip
-avoid calling memcpy() with NULL argument, even if len is 0
Diffstat (limited to 'src/fs/fs_getopt.c')
-rw-r--r--src/fs/fs_getopt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fs/fs_getopt.c b/src/fs/fs_getopt.c
index 8657c62de..f78e311d3 100644
--- a/src/fs/fs_getopt.c
+++ b/src/fs/fs_getopt.c
@@ -76,7 +76,7 @@ GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext
76 /* remove the quotes, keep the '+' */ 76 /* remove the quotes, keep the '+' */
77 val = GNUNET_malloc (slen - 1); 77 val = GNUNET_malloc (slen - 1);
78 val[0] = '+'; 78 val[0] = '+';
79 memcpy (&val[1], &value[2], slen - 3); 79 GNUNET_memcpy (&val[1], &value[2], slen - 3);
80 val[slen - 2] = '\0'; 80 val[slen - 2] = '\0';
81 } 81 }
82 else 82 else
@@ -92,7 +92,7 @@ GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext
92 /* remove the quotes, add a space */ 92 /* remove the quotes, add a space */
93 val = GNUNET_malloc (slen); 93 val = GNUNET_malloc (slen);
94 val[0] = ' '; 94 val[0] = ' ';
95 memcpy (&val[1], &value[1], slen - 2); 95 GNUNET_memcpy (&val[1], &value[1], slen - 2);
96 val[slen - 1] = '\0'; 96 val[slen - 1] = '\0';
97 } 97 }
98 else 98 else