[PATCH] 5.0 ISAPI cookie string free fix (#28929)

php.internals

Michael Sisolak

22 years ago
I believe that a bug was introduced with version 1.3 of php5isapi.c. The sapi_isapi_read_cookies() function used to return NULL when there were no cookies, but was changed to return "" instead. That's fine, but then HttpExtensionProc() attempts to free the non-ealloc'ed empty string and dies with an Access Violation. I believe this is the issue people are seeing in bug #28929. I've attached a patch for the PHP_5_0 branch that has sapi_isapi_read_cookes() return an empty_string constant, and uses STR_FREE to call efree() to protect the case of the empty_string value. For HEAD this patch would be easier becuase of the recent removal of empty_string - just return STR_EMPTY_ALLOC() and keep the efree() as is. Michael Sisolak msisolak@yahoo.com __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail

Andi Gutmans

22 years ago
You forgot to attach the patch... At 02:55 PM 7/20/2004 -0700, Michael Sisolak wrote:

Stefan Esser

22 years ago
Andi Gutmans wrote:
> You forgot to attach the patch...
Not necessary. I believe that certain webmail accounts have problems sending attachments to the list. I guess that is caused by whatever attaches the PHP-Internals tag to the end of every listmail. Stefan

Andi Gutmans

22 years ago
Michael, If you didn't forget, then maybe you can post a URL to the patch? Thanks, Andi At 12:34 AM 7/21/2004 +0200, Stefan Esser wrote:

Michael Sisolak

22 years ago
Andi, Yahoo in the sent mail shows the attachment, but it didn't show up in the list. I've posted it at: http://aduni.org/~msisolak/php5isapi.c.patch This is for the PHP_5_0 branch. I believe that for HEAD the change would just be to use STR_EMPTY_ALLOC() at the end of sapi_isapi_read_cookes(), but I don't have a build enviornment for HEAD to test. Michael --- Andi Gutmans <andi@zend.com> wrote:
> Michael, > If you didn't forget, then maybe you can post a URL to the patch? > > Thanks, > > Andi > > At 12:34 AM 7/21/2004 +0200, Stefan Esser wrote: > >Andi Gutmans wrote: > >>You forgot to attach the patch... > > > >Not necessary. I believe that certain webmail accounts have problems > >sending attachments to the list. I guess that is caused by whatever > >attaches the PHP-Internals tag to the end of every listmail. > > > >Stefan > >
__________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail

Andi Gutmans

22 years ago
I saw Edin commited a fix. Let me know if it still gives you problems. Andi At 07:07 PM 7/20/2004 -0700, Michael Sisolak wrote:

Edin Kadribasic

22 years ago
Hi Micheal, I have applied the fix to the CVS. Edin ----- Original Message ----- From: "Michael Sisolak" <msisolak@yahoo.com> To: <internals@lists.php.net> Sent: Tuesday, July 20, 2004 11:55 PM Subject: [PHP-DEV] [PATCH] 5.0 ISAPI cookie string free fix (#28929)
> I believe that a bug was introduced with version 1.3 of php5isapi.c. > The sapi_isapi_read_cookies() function used to return NULL when there > were no cookies, but was changed to return "" instead. That's fine, > but then HttpExtensionProc() attempts to free the non-ealloc'ed empty > string and dies with an Access Violation. I believe this is the issue > people are seeing in bug #28929. > > I've attached a patch for the PHP_5_0 branch that has > sapi_isapi_read_cookes() return an empty_string constant, and uses > STR_FREE to call efree() to protect the case of the empty_string value. > For HEAD this patch would be easier becuase of the recent removal of > empty_string - just return STR_EMPTY_ALLOC() and keep the efree() as > is. > > Michael Sisolak > msisolak@yahoo.com > > > > > __________________________________ > Do you Yahoo!? > New and Improved Yahoo! Mail - Send 10MB messages! > http://promotions.yahoo.com/new_mail >
---------------------------------------------------------------------------- ----