add extra byte for null terminator
This commit is contained in:
parent
5100a21163
commit
b9dbf0f21f
@ -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);
|
||||
|
Reference in New Issue
Block a user