Browse Source

Fix #2318 on macOS

yhirose 1 tháng trước cách đây
mục cha
commit
8d03ef1615
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      httplib.h

+ 1 - 0
httplib.h

@@ -4547,6 +4547,7 @@ inline int getaddrinfo_with_timeout(const char *node, const char *service,
 
   return ret;
 #elif TARGET_OS_MAC
+  if (!node) { return EAI_NONAME; }
   // macOS implementation using CFHost API for asynchronous DNS resolution
   CFStringRef hostname_ref = CFStringCreateWithCString(
       kCFAllocatorDefault, node, kCFStringEncodingUTF8);