From 34f5392dc97d411d437c963af3a6a8ade2529306 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 15 Sep 2013 16:58:09 +0000 Subject: auto-correct missing 0-terminators in C_STRINGS/UTF-8 strings --- src/fs/gnunet-helper-fs-publish.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/fs/gnunet-helper-fs-publish.c') diff --git a/src/fs/gnunet-helper-fs-publish.c b/src/fs/gnunet-helper-fs-publish.c index 36af59cc8..cc58f62b5 100644 --- a/src/fs/gnunet-helper-fs-publish.c +++ b/src/fs/gnunet-helper-fs-publish.c @@ -119,11 +119,11 @@ add_to_md (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, if ( ((EXTRACTOR_METAFORMAT_UTF8 == format) || (EXTRACTOR_METAFORMAT_C_STRING == format)) && - ('\0' != data[data_size - 1]) ) + ('\0' != data[data_len - 1]) ) { char zdata[data_len + 1]; memcpy (zdata, data, data_len); - zdata[data_size] = '\0'; + zdata[data_len] = '\0'; (void) GNUNET_CONTAINER_meta_data_insert (md, plugin_name, type, format, data_mime_type, zdata, data_len + 1); } -- cgit v1.2.3