php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59289 zend_parse_parameters 64bit segfaults
Submitted: 2010-07-02 04:30 UTC Modified: 2010-07-20 15:06 UTC
From: viktors at ok dot lv Assigned:
Status: Closed Package: gnupg (PECL)
PHP Version: 5.3.2 OS: linux 64bit
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: viktors at ok dot lv
New email:
PHP Version: OS:

 

 [2010-07-02 04:30 UTC] viktors at ok dot lv
Description:
------------
Memory corruption on 64bit oses.

On 32bit systems sizeof(long)=4 bytes, but on 64bit systems sizeof(long)=8 bytes.
When using zend_parse_parameters() "l" modifier, the receiving argument must be long, not int.
Here is the patch that fixes these issues:
--- gnupg.c.orig	2010-07-02 10:44:22.000000000 +0300
+++ gnupg.c	2010-07-02 11:21:25.000000000 +0300
@@ -472,7 +472,7 @@
  * >0 = on
  * */
 PHP_FUNCTION(gnupg_setarmor){
-	int		armor;
+	long		armor;
 
 	GNUPG_GETOBJ();
 
@@ -498,7 +498,7 @@
 
 /* {{{ proto bool gnupg_seterrormode(int errormde) */
 PHP_FUNCTION(gnupg_seterrormode){
-	int errormode;
+	long errormode;
 
 	GNUPG_GETOBJ();
 
@@ -533,7 +533,7 @@
  * sets the mode for signing operations
  */
 PHP_FUNCTION(gnupg_setsignmode){
-	int			 signmode;
+	long			 signmode;
 
 	GNUPG_GETOBJ();
 
@@ -1396,7 +1396,7 @@
 PHP_FUNCTION(gnupg_deletekey){
 	char	*key;
 	int		key_len;
-	int		allow_secret = 0;
+	long		allow_secret = 0;
 
 	gpgme_key_t	gpgme_key;
 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-20 15:06 UTC] mgdm@php.net
This bug has been fixed in SVN.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC