mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Corrected string escape calculation.
This commit is contained in:
parent
0dd2280102
commit
0eb7000b0a
2 changed files with 3 additions and 3 deletions
|
@ -142,7 +142,7 @@ PS_WRITE_FUNC(sqlite)
|
|||
|
||||
t = time(NULL);
|
||||
|
||||
binary = emalloc(1 + 5 + vallen * (256 / 253));
|
||||
binary = emalloc(1 + 5 + vallen * ((float) 256 / (float) 253));
|
||||
binlen = sqlite_encode_binary((const unsigned char*)val, vallen, binary);
|
||||
|
||||
rv = sqlite_exec_printf(db, "REPLACE INTO session_data VALUES('%q', '%q', %d)", NULL, NULL, &error, key, binary, t);
|
||||
|
|
|
@ -2611,7 +2611,7 @@ PHP_FUNCTION(sqlite_escape_string)
|
|||
/* binary string */
|
||||
int enclen;
|
||||
|
||||
ret = emalloc( 1 + 5 + stringlen * (256 / 253) );
|
||||
ret = emalloc( 1 + 5 + stringlen * ((float) 256 / (float) 253) );
|
||||
ret[0] = '\x01';
|
||||
enclen = php_sqlite_encode_binary(string, stringlen, ret+1);
|
||||
RETVAL_STRINGL(ret, enclen+1, 0);
|
||||
|
@ -2841,7 +2841,7 @@ PHP_FUNCTION(sqlite_udf_encode_binary)
|
|||
int enclen;
|
||||
char *ret;
|
||||
|
||||
ret = emalloc( 1 + 5 + datalen * (256 / 253) );
|
||||
ret = emalloc( 1 + 5 + datalen * ((float) 256 / (float) 253) );
|
||||
ret[0] = '\x01';
|
||||
enclen = php_sqlite_encode_binary(data, datalen, ret+1);
|
||||
RETVAL_STRINGL(ret, enclen+1, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue