Edit report at https://bugs.php.net/bug.php?id=80424&edit=1

 ID:                 80424
 Updated by:         [email protected]
 Reported by:        Mr dot Miteshah at gmail dot com
 Summary:            mcrypt-1.0.3/mcrypt.c Missing ; on codes
 Status:             Open
 Type:               Bug
 Package:            PECL
 Operating System:   Ubuntu
 PHP Version:        8.0.0RC5
-Assigned To:        
+Assigned To:        derick
 Block user comment: N
 Private report:     N

 New Comment:

Indeed, a PHP 8 issue only (formerly that semicolon was not
required).  Anyhow, that would be covered by
<https://github.com/php/pecl-encryption-mcrypt/pull/6>, but I do
not understand why someone still wanted to use mcrypt with PHP 8.


Previous Comments:
------------------------------------------------------------------------
[2020-11-26 13:51:08] Mr dot Miteshah at gmail dot com

Description:
------------

The last make command give us following errors when i checked code `;` was 
missing on few functons.

vim /tmp/mcrypt-1.0.3/mcrypt.c +687
        if (data_len == 0) {
                php_error_docref(NULL, E_WARNING, "An empty string was passed");
                RETURN_FALSE
        }

        /* Check blocksize */
        if (data_len > INT_MAX) {
                php_error_docref(NULL, E_WARNING, "Data size too large, %d 
maximum", INT_MAX);
                RETURN_FALSE;
        }

As you see on first function RETURN_FALSE was missing `;` while same code on 
2nd function had `;` added properly.



rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT TERM XCPU XFSZ], NULL, 8) = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, 
child_tidptr=0x7f35c2297a10) = 9921
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
wait4(-1, libtool: compile:  cc -I. -I/tmp/mcrypt-1.0.3 
-I/tmp/mcrypt-1.0.3/include -I/tmp/mcrypt-1.0.3/main -I/tmp/mcrypt-1.0.3 
-I/usr/include/php/20200930 -I/usr/include/php/20200930/main 
-I/usr/include/php/20200930/TSRM -I/usr/include/php/20200930/Zend 
-I/usr/include/php/20200930/ext -I/usr/include/php/20200930/ext/date/lib 
-DHAVE_CONFIG_H -g -O2 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c 
/tmp/mcrypt-1.0.3/mcrypt.c  -fPIC -DPIC -o .libs/mcrypt.o
/tmp/mcrypt-1.0.3/mcrypt.c: In function ‘zif_mdecrypt_generic’:
/tmp/mcrypt-1.0.3/mcrypt.c:687:2: error: expected ‘;’ before ‘}’ token
  }
  ^
/tmp/mcrypt-1.0.3/mcrypt.c: In function ‘zif_mcrypt_generic_deinit’:
/tmp/mcrypt-1.0.3/mcrypt.c:766:2: error: expected ‘;’ before ‘}’ token
  }
  ^
/tmp/mcrypt-1.0.3/mcrypt.c:769:1: error: expected ‘;’ before ‘}’ token
 }
 ^
/tmp/mcrypt-1.0.3/mcrypt.c: In function 
‘zif_mcrypt_enc_is_block_algorithm_mode’:
/tmp/mcrypt-1.0.3/mcrypt.c:780:2: error: expected ‘;’ before ‘}’ token
  } else {
  ^
/tmp/mcrypt-1.0.3/mcrypt.c:780:4: error: expected ‘}’ before ‘else’
  } else {
    ^~~~
/tmp/mcrypt-1.0.3/mcrypt.c:782:2: error: expected ‘;’ before ‘}’ token
  }
  ^
/tmp/mcrypt-1.0.3/mcrypt.c: In function ‘zif_mcrypt_enc_is_block_algorithm’:
/tmp/mcrypt-1.0.3/mcrypt.c:794:2: error: expected ‘;’ before ‘}’ token
  } else {
  ^
/tmp/mcrypt-1.0.3/mcrypt.c:794:4: error: expected ‘}’ before ‘else’
  } else {
    ^~~~
/tmp/mcrypt-1.0.3/mcrypt.c:796:2: error: expected ‘;’ before ‘}’ token
  }
  ^
/tmp/mcrypt-1.0.3/mcrypt.c: In function ‘zif_mcrypt_enc_is_block_mode’:
/tmp/mcrypt-1.0.3/mcrypt.c:808:2: error: expected ‘;’ before ‘}’ token
  } else {
  ^
/tmp/mcrypt-1.0.3/mcrypt.c:808:4: error: expected ‘}’ before ‘else’
  } else {
    ^~~~
/tmp/mcrypt-1.0.3/mcrypt.c:810:2: error: expected ‘;’ before ‘}’ token
  }
  ^
/tmp/mcrypt-1.0.3/mcrypt.c:1144:14: error: invalid storage class for function 
‘php_mcrypt_get_key_size_str’
 static char *php_mcrypt_get_key_size_str(
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/mcrypt-1.0.3/mcrypt.c:1181:18: error: invalid storage class for function 
‘php_mcrypt_is_valid_key_size’
 static zend_bool php_mcrypt_is_valid_key_size(
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/mcrypt-1.0.3/mcrypt.c:1205:12: error: invalid storage class for function 
‘php_mcrypt_ensure_valid_key_size’
 static int php_mcrypt_ensure_valid_key_size(MCRYPT td, int key_size) /* {{{ */
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/mcrypt-1.0.3/mcrypt.c:1232:12: error: invalid storage class for function 
‘php_mcrypt_ensure_valid_iv’
 static int php_mcrypt_ensure_valid_iv(MCRYPT td, const char *iv, int iv_size) 
/* {{{ */
            ^~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/mcrypt-1.0.3/mcrypt.c:1261:13: error: invalid storage class for function 
‘php_mcrypt_do_crypt’
 static void php_mcrypt_do_crypt(char* cipher, const char *key, size_t key_len, 
const char *data, size_t data_len, char *mode, const char *iv, size_t iv_len, 
size_t dencrypt, zval* return_value) /* {{{ */
             ^~~~~~~~~~~~~~~~~~~
/tmp/mcrypt-1.0.3/mcrypt.c:1421:1: error: expected declaration or statement at 
end of input
 }
 ^
/tmp/mcrypt-1.0.3/mcrypt.c: In function ‘zif_mcrypt_enc_is_block_algorithm’:
/tmp/mcrypt-1.0.3/mcrypt.c:1421:1: error: expected declaration or statement at 
end of input
/tmp/mcrypt-1.0.3/mcrypt.c: In function 
‘zif_mcrypt_enc_is_block_algorithm_mode’:
/tmp/mcrypt-1.0.3/mcrypt.c:1421:1: error: expected declaration or statement at 
end of input
/tmp/mcrypt-1.0.3/mcrypt.c: In function ‘zif_mcrypt_generic_deinit’:
/tmp/mcrypt-1.0.3/mcrypt.c:1421:1: error: expected declaration or statement at 
end of input
/tmp/mcrypt-1.0.3/mcrypt.c:1421:1: error: expected declaration or statement at 
end of input
/tmp/mcrypt-1.0.3/mcrypt.c: In function ‘zif_mdecrypt_generic’:
/tmp/mcrypt-1.0.3/mcrypt.c:1421:1: error: expected declaration or statement at 
end of input
[{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 9921
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=9921, si_uid=0, 
si_status=1, si_utime=4, si_stime=0} ---
rt_sigreturn({mask=[]})                 = 9921
openat(AT_FDCWD, "/usr/share/locale/C.UTF-8/LC_MESSAGES/make.mo", O_RDONLY) = 
-1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/C.utf8/LC_MESSAGES/make.mo", O_RDONLY) = -1 
ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/C/LC_MESSAGES/make.mo", O_RDONLY) = -1 
ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale-langpack/C.UTF-8/LC_MESSAGES/make.mo", 
O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale-langpack/C.utf8/LC_MESSAGES/make.mo", 
O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale-langpack/C/LC_MESSAGES/make.mo", O_RDONLY) 
= -1 ENOENT (No such file or directory)
write(1, "Makefile:209: recipe for target "..., 51Makefile:209: recipe for 
target 'mcrypt.lo' failed
) = 51
write(2, "make: *** [mcrypt.lo] Error 1\n", 30make: *** [mcrypt.lo] Error 1
) = 30
rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT TERM XCPU XFSZ], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
chdir("/tmp/mcrypt-1.0.3")              = 0
close(1)                                = 0
exit_group(2)                           = ?
+++ exited with 2 +++

Test script:
---------------
wget -O /tmp/mcrypt-1.0.3.tgz http://pecl.php.net/get/mcrypt-1.0.3.tgz
cd /tmp
tar xf mcrypt-1.0.3.tgz
cd mcrypt-1.0.3
phpize8.0
./configure --with-php-config=/usr/bin/php-config8.0
make clean
make

Expected result:
----------------
make command work without any error.

Actual result:
--------------
make command failed.


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=80424&edit=1

-- 
PECL development discussion Mailing List (https://pecl.php.net/)
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to