Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 27 Out of memory occurs when the DoH server returns an failed response #12365

Closed
lRoccoon opened this issue Nov 20, 2023 · 1 comment
Closed
Labels
name lookup DNS and related tech

Comments

@lRoccoon
Copy link

I did this

A DoH server (https://dig.bdurl.net/dns-query) has some problem,when I use this doh server and use -4, I got Error 27: Out of memory.

curl -4 --doh-url https://dig.bdurl.net/dns-query google.com
curl: (27) Out of memory

I suspect it's caused by TTL

* Connection #1 to host dig.bdurl.net left intact
* a DoH request is completed, 0 to go
* DoH: Too small type A for google.com
* DoH Host name: google.com
* TTL: 2147483647 seconds
* Closing connection 0
curl: (27) Out of memory

I expected the following

curl -4 --doh-url https://dig.bdurl.net/dns-query google.com
curl: (6) Couldn't resolve host name

curl/libcurl version

curl 8.1.2 (x86_64-apple-darwin23.0) libcurl/8.1.2 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.55.1
Release-Date: 2023-05-30
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL threadsafe UnixSockets

operating system

Linux 5.4.143
Mac OS 14.1

@bagder bagder added the name lookup DNS and related tech label Nov 20, 2023
@bagder
Copy link
Member

bagder commented Nov 20, 2023

I can reproduce and I see why...

bagder added a commit that referenced this issue Nov 20, 2023
Previously it was wrongly returning CURLE_OUT_OF_MEMORY when the
response did not contain any addresses. Now it more accurately returns
CURLE_COULDNT_RESOLVE_HOST.

Reported-by: lRoccoon on github

Fixes #12365
@bagder bagder closed this as completed in db5bf23 Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
name lookup DNS and related tech
Development

Successfully merging a pull request may close this issue.

2 participants