-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Description
I did this
Area: Curl_resolv() in lib/hostip.c (post-resolve path)
Summary: After a successful resolve (addr non-NULL), failures in Curl_dnscache_mk_entry() or Curl_dnscache_add() fall through the generic error: path, returning CURLE_COULDNT_RESOLVE_HOST and calling store_negative_resolve().
Impact: Inserts a negative cache entry for a host that actually resolves, causing subsequent lookups to fail immediately ("Negative DNS entry"). Can persist if cache timeout is infinite. Misleads users with the wrong error.
Repro: Induce low-memory so mk_entry or cache insertion fails after addr is obtained. Next lookup returns negative-cached failure.
Expected: No negative caching on post-resolve bookkeeping failures; return a failure without poisoning cache (keeping Curl_resolv()'s return contract).
Actual: Returns CURLE_COULDNT_RESOLVE_HOST and negative-caches.
Fix (minimal): Handle these two OOM sites by returning directly with a log (failf) and do not jump to error: (which does negative caching).
I expected the following
does not negative cache
curl/libcurl version
current
operating system
all