(not on list, cc on replies)

The documentation within include/apr_getopt.h says that the name argument within the option structure should be NULL if a long name is not present - but it performs a strlen on that value without checking for NULL.

-David Waite
Index: apr/misc/unix/getopt.c
===================================================================
RCS file: /home/cvspublic/apr/misc/unix/getopt.c,v
retrieving revision 1.35
diff -r1.35 getopt.c
240,243c240,246
<               len = strlen(opts[i].name);
<               if (strncmp(p, opts[i].name, len) == 0
<                   && (p[len] == '\0' || p[len] == '='))
<                   break;
---
>                 if (opts[i].name)
>                 {
>                     len = strlen(opts[i].name);
>                     if (strncmp(p, opts[i].name, len) == 0
>                         && (p[len] == '\0' || p[len] == '='))
>                         break;
>                 }

Reply via email to