From 05826491afd01420732b0b81a7871c2fc309b868 Mon Sep 17 00:00:00 2001 From: sunjingzhao Date: Sat, 11 Jul 2020 15:22:12 +0800 Subject: [PATCH] libobs/util: Fix potential crash --- libobs/util/dstr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libobs/util/dstr.c b/libobs/util/dstr.c index 0f6ec099d..d1ee98233 100644 --- a/libobs/util/dstr.c +++ b/libobs/util/dstr.c @@ -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));