relative.c: fix potential heap buffer overflow

This commit is contained in:
Gleb Fotengauer-Malinovskiy 2016-03-10 19:14:27 +03:00
parent b78cc75d12
commit 03302d4963

View File

@ -141,7 +141,7 @@ main(int ac, char *av[])
if (!*what_p && !*to_p)
result(base_name(orig_what));
res = xmalloc(strlen(what) + strlen(to) * 3 / 2 + 3);
res = xmalloc(strlen(orig_what) + strlen(to) * 3 / 2 + 3);
if (('/' == *what_p) && !*to_p)
result(orig_what + (++what_p - what));