aboutsummaryrefslogtreecommitdiff
path: root/src/statistics
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/statistics
parent5184c17d32a39c928c2a0fec3ee1ad098bbaa562 (diff)
downloadgnunet-d8c53b12a818ff7cf82d06a1a69c395bdef85ee6.tar.gz
gnunet-d8c53b12a818ff7cf82d06a1a69c395bdef85ee6.zip
-avoid calling memcpy() with NULL argument, even if len is 0
Diffstat (limited to 'src/statistics')
-rw-r--r--src/statistics/gnunet-service-statistics.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/statistics/gnunet-service-statistics.c b/src/statistics/gnunet-service-statistics.c
index 8d989dafb..c0be7c668 100644
--- a/src/statistics/gnunet-service-statistics.c
+++ b/src/statistics/gnunet-service-statistics.c
@@ -654,7 +654,7 @@ find_subsystem_entry (struct ClientEntry *ce,
654 slen = strlen (service) + 1; 654 slen = strlen (service) + 1;
655 se = GNUNET_malloc (sizeof (struct SubsystemEntry) + 655 se = GNUNET_malloc (sizeof (struct SubsystemEntry) +
656 slen); 656 slen);
657 memcpy (&se[1], 657 GNUNET_memcpy (&se[1],
658 service, 658 service,
659 slen); 659 slen);
660 se->service = (const char *) &se[1]; 660 se->service = (const char *) &se[1];
@@ -805,7 +805,7 @@ handle_set (void *cls,
805 /* not found, create a new entry */ 805 /* not found, create a new entry */
806 nlen = strlen (name) + 1; 806 nlen = strlen (name) + 1;
807 pos = GNUNET_malloc (sizeof (struct StatsEntry) + nlen); 807 pos = GNUNET_malloc (sizeof (struct StatsEntry) + nlen);
808 memcpy (&pos[1], 808 GNUNET_memcpy (&pos[1],
809 name, 809 name,
810 nlen); 810 nlen);
811 pos->name = (const char *) &pos[1]; 811 pos->name = (const char *) &pos[1];
@@ -895,7 +895,7 @@ handle_watch (void *cls,
895 nlen = strlen (name) + 1; 895 nlen = strlen (name) + 1;
896 pos = GNUNET_malloc (sizeof (struct StatsEntry) + 896 pos = GNUNET_malloc (sizeof (struct StatsEntry) +
897 nlen); 897 nlen);
898 memcpy (&pos[1], name, nlen); 898 GNUNET_memcpy (&pos[1], name, nlen);
899 pos->name = (const char *) &pos[1]; 899 pos->name = (const char *) &pos[1];
900 pos->subsystem = se; 900 pos->subsystem = se;
901 GNUNET_CONTAINER_DLL_insert (se->stat_head, 901 GNUNET_CONTAINER_DLL_insert (se->stat_head,