libobs/util: Fix potential crash

This commit is contained in:
sunjingzhao 2020-07-11 15:22:12 +08:00 committed by jp9000
parent c539beb305
commit 05826491af

View File

@ -218,7 +218,7 @@ char *strdepad(char *str)
while (is_padding(*temp))
++temp;
len = strlen(str);
len = strlen(temp);
if (temp != str)
memmove(str, temp, len + 1);
@ -247,7 +247,7 @@ wchar_t *wcsdepad(wchar_t *str)
while (*temp == ' ' || *temp == '\t')
++temp;
len = wcslen(str);
len = wcslen(temp);
if (temp != str)
memmove(str, temp, (len + 1) * sizeof(wchar_t));