cURL / Mailing Lists / curl-users / Single Mail


[ curl-Bugs-566835 ] strlen() with NULL ptr on Solaris

From: <>
Date: Mon, 10 Jun 2002 06:33:14 -0700

Bugs item #566835, was opened at 2002-06-10 06:33
You can respond by visiting:

Category: libcurl
Group: crash
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Daniel Stenberg (bagder)
Summary: strlen() with NULL ptr on Solaris

Initial Comment:
We had problems running cURL 7.9.6 on Solaris due
to a call to the standard library function strlen()
with a NULL pointer. This would cause a crash.
This happened on Solaris versions 7 and 8.

To fix the problem we wrote a new strlen() and
provided a curl cover function and a macro that
would replace calls to strlen() in the code.

The new file strlen.h has the declaration:

        size_t curl_strlen(const char *s);
        #define strlen(a) curl_strlen(a)

The file strlen.c contains the implementation:

        #include "setup.h"
        #include <string.h>
        #include <ctype.h>

        size_t curl_strlen(const char *s)
                int len = 0;
                if (0 != s)
                        len = strlen(s);
                return len;

We included strlen.h in the following files:

Finally, we included strlen.c and strlen.h in where appropriate.


You can respond by visiting:


Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -
Received on 2002-06-10