e_os.h removal from other headers and source files.
[openssl.git] / crypto / dso / dso_lib.c
index 8f185b38283cdd870c3a8b9374175712ba3c95db..3645c8d603ae21e20c2ee0d151b517fdc1f2847d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the OpenSSL license (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -8,6 +8,7 @@
  */
 
 #include "dso_locl.h"
+#include "e_os.h"
 
 static DSO_METHOD *default_DSO_meth = NULL;
 
@@ -324,6 +325,9 @@ DSO *DSO_dsobyaddr(void *addr, int flags)
     char *filename = NULL;
     int len = DSO_pathbyaddr(addr, NULL, 0);
 
+    if (len < 0)
+        return NULL;
+
     filename = OPENSSL_malloc(len);
     if (filename != NULL
             && DSO_pathbyaddr(addr, filename, len) == len)