Re: PHP Annual Bughunt!

From: Date: Tue, 02 Jul 2002 22:53:09 +0000
Subject: Re: PHP Annual Bughunt!
References: 1  Groups: php.qa 
Request: Send a blank email to php-qa+get-5588@lists.php.net to get a copy of this message
At 15:21 1-7-2002, Derick Rethans shared with all of us:
Hello QA-ers, it's the time of the year again, time for the PHP Bug Hunt Event! Although this is the first time, I'm pretty sure it will be fine. How do I participate? --------------------- Easy! Take a look at http://www.php.net/~derick/bugpacks.html . You will see 51 bug packs with bugs in it, nicely categorized. I'm asking you to pick one (or more of these 'Bugpacks') to take care of. Taking care of
RE: pack 51/17791 Does it make sence for the php extension to 'guard' against this, even though it's: 1) a user error 2) a Sablotron error On the other hand - a path+filename can in real life make up more than 512 bytes. So - it should probably be a patch on both sides, where a constant is defined or used from an os header, for the max length of a filename. I was thinking along the lines of: Index: sablot.c =================================================================== RCS file: /repository/php4/ext/xslt/sablot.c,v retrieving revision 1.48 diff -u -r1.48 sablot.c
--- sablot.c    29 Jun 2002 01:55:34 -0000      1.48
+++ sablot.c    2 Jul 2002 22:51:05 -0000
@@ -37,6 +37,10 @@ #include <sys/stat.h> #include <fcntl.h> +#ifndef SABLOT_MAX_FILENAME_LEN
+       #define SABLOT_MAX_FILENAME_LEN 512
+#endif + /* functions relating to handlers */ static void register_sax_handler_pair(zval **, zval **, zval **); @@ -495,6 +499,12 @@
        else {
                convert_to_string_ex(result_p);
                result = Z_STRVAL_PP(result_p);
+       }
+
+       if (argc == 3) {
+               if(sizeof(xml) > SABLOT_MAX_FILENAME_LEN || sizeof(xslt) > SABLOT_MAX_FILENAME_LEN ) {
+                       RETURN_FALSE;
+               }
        }
        /* Translate a PHP array into a Sablotron array */
Met vriendelijke groeten / With kind regards, IDG.nl Melvyn Sopacua Webmaster

« previous php.qa (#5588) next »