ConnectionExists: avoid NULL dereference
authorDaniel Stenberg <daniel@haxx.se>
Fri, 29 Apr 2011 14:46:49 +0000 (16:46 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 29 Apr 2011 14:46:49 +0000 (16:46 +0200)
When checking for connections that are bound to a particular device we
must make sure we don't compare with a NULL pointer.

lib/url.c

index 7c70be8184174692b4892f969df08e9ad4cf7e71..fa0557711574472a669ee225fd3f604d6c6972a9 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -2948,6 +2948,7 @@ ConnectionExists(struct SessionHandle *data,
       if((check->localport != needle->localport) ||
          (check->localportrange != needle->localportrange) ||
          !check->localdev ||
+         !needle->localdev ||
          strcmp(check->localdev, needle->localdev))
         continue;
     }