Fix under-allocation in getVersion

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
Mcat12
2018-01-21 10:54:59 -05:00
parent be5815fbda
commit 9007af7dbb
+1 -1
View File
@@ -1000,7 +1000,7 @@ void getVersion(int *sock)
if(istelnet[*sock])
ssend(*sock, "version vDev-%s\ntag %s\nbranch %s\ndate %s\n", hash, tag, GIT_BRANCH, GIT_DATE);
else {
char *hashVersion = calloc(5 + strlen(hash), sizeof(char));
char *hashVersion = calloc(6 + strlen(hash), sizeof(char));
sprintf(hashVersion, "vDev-%s", hash);
pack_str32(*sock, hashVersion);