apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Hill <David.D.H...@Compaq.com>
Subject How bullet proof ?
Date Wed, 17 Apr 2002 20:00:25 GMT


Hi,
    I was just debugging a module and ran into an interesting question.
The module caused a SEGV in

AP_DECLARE(char *) ap_make_full_path(apr_pool_t *a, const char *src1,
                                  const char *src2)

because it passed a NULL in a src2, which caused the segv when
strlen(src2) was called.

My first inclination was to think "what a bonehead thing to do", my
second inclination was that maybe
apr should protect me from myself a bit more....

Wouldn't it make sense to make a path in that case with only src1 as the
content ?
-or-
Wouldn't it make sense fo the function to return a NULL back to the
caller if src1 or src2 are null
-or-
Wouldn't it make sense for me just to check my arguments be for calling
apr :-)

Dave Hill

--
+---------------------oOO--(_)--OOo------------------------+
|Dave Hill                (0 0)    Unix Software Group     |
|Mailstop: ZKO3-2/W17     \//\/                            |
|Digital Equipment Corp.           (603 )884-2985          |
|110 Spitbrook Road       /\//\    enet: ddhill@zk3.dec.com|
|Nashua, NH 03062-2698    (0_0)                            |
+---------------------oOO--(_)--OOo------------------------+




Mime
View raw message