浏览代码

Fix #2318 on macOS

yhirose 1 月之前
父节点
当前提交
8d03ef1615
共有 1 个文件被更改,包括 1 次插入0 次删除
  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);