mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
MFH: fix #38961 (metaphone() results in segmentation fault on NetBSD)
This commit is contained in:
parent
4b286026c3
commit
b805c9e089
2
NEWS
2
NEWS
@ -6,6 +6,8 @@ PHP NEWS
|
||||
- Fixed mess with CGI/CLI -d option (now it works with cgi; constants are
|
||||
working exactly like in php.ini; with FastCGI -d affects all requests).
|
||||
(Dmitry)
|
||||
- Fixed bug #38961 (metaphone() results in segmentation fault on NetBSD).
|
||||
(Tony)
|
||||
- Fixed bug #38942 (Double old-style-ctor inheritance). (Dmitry)
|
||||
- Fixed bug #38941 (imap extension does not compile against new version of
|
||||
the imap library). (Ilia)
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "php.h"
|
||||
#include "php_metaphone.h"
|
||||
|
||||
static int metaphone(char *word, int word_len, long max_phonemes, char **phoned_word, int traditional);
|
||||
static int metaphone(unsigned char *word, int word_len, long max_phonemes, char **phoned_word, int traditional);
|
||||
|
||||
/* {{{ proto string metaphone(string text[, int phones])
|
||||
Break english phrases down into their phonemes */
|
||||
@ -41,7 +41,7 @@ PHP_FUNCTION(metaphone)
|
||||
return;
|
||||
}
|
||||
|
||||
if (metaphone(str, str_len, phones, &result, 1) == 0) {
|
||||
if (metaphone((unsigned char *)str, str_len, phones, &result, 1) == 0) {
|
||||
RETVAL_STRING(result, 0);
|
||||
} else {
|
||||
if (result) {
|
||||
@ -159,7 +159,7 @@ static char Lookahead(char *word, int how_far)
|
||||
|
||||
/* {{{ metaphone
|
||||
*/
|
||||
static int metaphone(char *word, int word_len, long max_phonemes, char **phoned_word, int traditional)
|
||||
static int metaphone(unsigned char *word, int word_len, long max_phonemes, char **phoned_word, int traditional)
|
||||
{
|
||||
int w_idx = 0; /* point in the phonization we're at. */
|
||||
int p_idx = 0; /* end of the phoned phrase */
|
||||
|
Loading…
Reference in New Issue
Block a user