Browse Source

libobs: Fix buffer overrun in os_wcs_to_utf8()

derrod 1 year ago
parent
commit
95a753b9d8
1 changed files with 1 additions and 2 deletions
  1. 1 2
      libobs/util/platform.c

+ 1 - 2
libobs/util/platform.c

@@ -429,8 +429,7 @@ size_t os_wcs_to_utf8(const wchar_t *str, size_t len, char *dst,
 			return 0;
 			return 0;
 
 
 		if (out_len)
 		if (out_len)
-			out_len =
-				wchar_to_utf8(str, in_len, dst, out_len + 1, 0);
+			out_len = wchar_to_utf8(str, in_len, dst, out_len, 0);
 
 
 		dst[out_len] = 0;
 		dst[out_len] = 0;
 	}
 	}