diff --git a/src/www_files.c b/src/www_files.c index 4f6cc17..59fd0b4 100644 --- a/src/www_files.c +++ b/src/www_files.c @@ -257,9 +257,9 @@ char *www_create_link(int dir, int sub, int fid) { sizereq = hashids_estimate_encoded_size_v(hashids, 4, gUser->id, dir, sub, fid); - hashid = (char *)malloc(sizereq); + hashid = (char *)malloc(sizereq + 1); - memset(hashid, 0, sizereq); + memset(hashid, 0, sizereq + 1); if (hashids_encode_v(hashids, hashid, 4, gUser->id, dir, sub, fid) == 0) { hashids_free(hashids);