com php-src: Use unsigned char in _crypt_extended_r: ext/standard/crypt.c ext/standard/crypt_freesec.c ext /standard/crypt_freesec.h

From: Date: Wed, 19 Jun 2019 13:09:00 +0000
Subject: com php-src: Use unsigned char in _crypt_extended_r: ext/standard/crypt.c ext/standard/crypt_freesec.c ext /standard/crypt_freesec.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-106899@lists.php.net to get a copy of this message
Commit: 4b5e824aae7117d53f4f1be1351d3eaa79329a40 Author: Nikita Popov <nikita.ppv@gmail.com> Wed, 19 Jun 2019 13:48:20 +0200 Parents: bee7973e52a184a9bde60b5cda7a2c47c97e36ef Branches: PHP-7.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4b5e824aae7117d53f4f1be1351d3eaa79329a40 Log: Use unsigned char in _crypt_extended_r Avoid signed shift UB. Changed paths: M ext/standard/crypt.c M ext/standard/crypt_freesec.c M ext/standard/crypt_freesec.h Diff: diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index 068d743..d0b1e6a 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -179,7 +179,7 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const ch memset(&buffer, 0, sizeof(buffer)); _crypt_extended_init_r(); - crypt_res = _crypt_extended_r(password, salt, &buffer); + crypt_res = _crypt_extended_r((const unsigned char *) password, salt, &buffer); if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) { return NULL; } else { diff --git a/ext/standard/crypt_freesec.c b/ext/standard/crypt_freesec.c index dc51b30..572e512 100644 --- a/ext/standard/crypt_freesec.c +++ b/ext/standard/crypt_freesec.c @@ -607,7 +607,7 @@ des_cipher(const char *in, char *out, uint32_t salt, int count, } char * -_crypt_extended_r(const char *key, const char *setting, +_crypt_extended_r(const unsigned char *key, const char *setting, struct php_crypt_extended_data *data) { int i; diff --git a/ext/standard/crypt_freesec.h b/ext/standard/crypt_freesec.h index c102736..69271f2 100644 --- a/ext/standard/crypt_freesec.h +++ b/ext/standard/crypt_freesec.h @@ -28,7 +28,7 @@ struct php_crypt_extended_data { void _crypt_extended_init(void); -char *_crypt_extended_r(const char *key, const char *setting, +char *_crypt_extended_r(const unsigned char *key, const char *setting, struct php_crypt_extended_data *data); #endif

« previous php.cvs (#106899) next »