httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Oppegaard <...@joppegaard.com>
Subject mod_usertrack.c modifications and child seg faults
Date Wed, 20 Nov 2002 11:35:32 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I made a minor modification to mod_usertrack.c so it would only hand out 
cookies if the content_type was text/html. I ran across some strange 
child segfaults.

The module is being compilied as a shared object.

In the following patch, if I use the uncommented if statement I get the
following in my error logs:
    [notice] child pid 11517 exit signal Segmentation fault (11)
(The browser also gets an error "Document has no data", obviously since the
request segfaulted.)

Once I switch over to the if statement that first checks for r->content_type
then calls strcmp, everything works just as expected.

Any ideas on why this is?

System info:
    gcc 3.2
    httpd-2.0.40
    redhat 8.0


Thanks,

- --- mod_usertrack.c.orig        2002-11-19 23:36:26.000000000 -0800
+++ mod_usertrack.c     2002-11-19 23:37:55.000000000 -0800
@@ -222,8 +222,16 @@

             return DECLINED;    /* There's already a cookie, no new one */
         }
- -    make_cookie(r);
- -    return OK;                  /* We set our cookie */
+
+
+    /*if (r->content_type && strcmp(r->content_type,"text/html") == 0) {*/
+    if (strcmp(r->content_type,"text/html") == 0) {
+        make_cookie(r);
+        return OK;
+    }
+    else {
+        return DECLINED;
+    }
 }

 static void *make_cookie_log_state(apr_pool_t *p, server_rec *s)


___
Joe Oppegaard
http://joppegaard.com

GnuPG/PGP Information:
Key: 1024D/272159F6
Keyserver: pgp.mit.edu
By web: http://joppegaard.com/files/0x272159F6.asc


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Joe Oppegaard <mailto:joe@joppegaard.com> 0x272159F6

iD8DBQE923OLv32V7ychWfYRAsu+AJ9o2S6hayBwDXHI5Sqa8o9SeENcZACguFQE
y9emAaKvjuiJbhRzTgdC30w=
=X7VN
-----END PGP SIGNATURE-----



Mime
View raw message