Skip to content

Commit c7e57f5

Browse files
Renegade334richardlau
authored andcommitted
deps: c-ares: cherry-pick 8ba37af8e3fb
Original commit message: Fixes #1056 The commit c-ares/c-ares@1d1b3d4 refactored the function to use wide strings, but didn't touch this check. Because an empty wide string would now be size 2 and not 1, the empty string would go on and cause the DNS domain list to be replaced with nothing. Signed-off-by: @dankmeme01 Refs: c-ares/c-ares@8ba37af PR-URL: #64110 Fixes: #62347 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 7a16ccc commit c7e57f5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

deps/cares/src/lib/ares_sysconfig_win.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static ares_bool_t get_REG_SZ(HKEY hKey, const WCHAR *leafKeyName, char **outptr
106106

107107
/* Get the value for real */
108108
res = RegQueryValueExW(hKey, leafKeyName, 0, NULL, (BYTE *)val, &size);
109-
if (res != ERROR_SUCCESS || size == 1) {
109+
if (res != ERROR_SUCCESS || size == sizeof(WCHAR)) {
110110
ares_free(val);
111111
return ARES_FALSE;
112112
}

0 commit comments

Comments
 (0)