diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-08-08 15:24:44 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-08-08 15:24:44 +0000 |
commit | d25cefa31b5b5c7c731cd390cfba7f730ab8cdcd (patch) | |
tree | 9433027b3908da6121d03a47c148ce43a5ead12b /src/fs/fs_publish_ublock.c | |
parent | b57e331a56521971070a55d1bb78f34e05c34577 (diff) |
-minor fixes
Diffstat (limited to 'src/fs/fs_publish_ublock.c')
-rw-r--r-- | src/fs/fs_publish_ublock.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fs/fs_publish_ublock.c b/src/fs/fs_publish_ublock.c index d4f65edc32..71997fda04 100644 --- a/src/fs/fs_publish_ublock.c +++ b/src/fs/fs_publish_ublock.c @@ -190,7 +190,7 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h, uris = GNUNET_FS_uri_to_string (uri); slen = strlen (uris) + 1; if (NULL == ulabel) - ulen = 0; + ulen = 1; else ulen = strlen (ulabel) + 1; size = mdsize + sizeof (struct UBlock) + slen + ulen; @@ -201,7 +201,8 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h, } ub_plain = GNUNET_malloc (size); kbe = (char *) &ub_plain[1]; - memcpy (kbe, ulabel, ulen); + if (NULL != ulabel) + memcpy (kbe, ulabel, ulen); kbe += ulen; memcpy (kbe, uris, slen); kbe += slen; |