Commit graph

468 commits

Author SHA1 Message Date
Jakub Zelenka
7c96af42b7
Merge branch 'PHP-8.3' into PHP-8.4 2024-11-20 11:14:04 +01:00
Jakub Zelenka
ffff27f734
Merge branch 'PHP-8.2' into PHP-8.3 2024-11-20 11:12:19 +01:00
Jakub Zelenka
d37a20c4a2
Fix MySQLnd possible buffer over read in auth_protocol 2024-11-20 11:06:53 +01:00
Jakub Zelenka
c595455300
Fix GHSA-h35g-vwh6-m678: Mysqlnd - various heap buffer over-reads
This fixes issues causing buffer over-read that leak heap content:
- RESP packet field default left over for COM_LIST
- RESP packet upsert filename
- OK packet message
- RESP packet for stmt row data
  - ps_fetch_from_1_to_8_bytes
  - ps_fetch_float
  - ps_fetch_double
  - ps_fetch_time
  - ps_fetch_date
  - ps_fetch_datetime
  - ps_fetch_string
  - ps_fetch_bit
- RESP packet for query row data (just possible overflow on 32bit)

It also adds various protocol tests using a new fake server.
2024-11-20 11:06:26 +01:00
^_^
555b603d23
mysqlnd: support ER_CLIENT_INTERACTION_TIMEOUT (#13618) 2024-08-26 12:52:26 +09:00
Kamil Tekiela
a1ab846231
MySQL 9: Add support for VECTOR type (#15431) 2024-08-20 17:34:52 +02:00
Niels Dossche
b1fd3477b2 mysqlnd: change uses of sprintf into snprintf 2024-06-14 08:12:03 -07:00
Jakub Zelenka
d24086b7ba
Merge branch 'PHP-8.3' 2024-04-12 11:04:41 +01:00
Jakub Zelenka
fbcad699cb
Merge branch 'PHP-8.2' into PHP-8.3 2024-04-12 10:57:42 +01:00
Jakub Zelenka
3b93f13199
Revert "ext/mysqlnd: support ER_CLIENT_INTERACTION_TIMEOUT"
This reverts commit 5035b85090.

This broke Doctrine DBAL tests - more discussion in GH-13618.
2024-04-12 10:56:09 +01:00
Kamil Tekiela
72f94a127f
Merge branch 'PHP-8.3'
* PHP-8.3:
  ext/mysqlnd: support ER_CLIENT_INTERACTION_TIMEOUT
2024-04-10 13:37:36 +02:00
Kamil Tekiela
acf9047346
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ext/mysqlnd: support ER_CLIENT_INTERACTION_TIMEOUT
2024-04-10 13:35:14 +02:00
Appla
5035b85090
ext/mysqlnd: support ER_CLIENT_INTERACTION_TIMEOUT
Closes GH-13618.
2024-04-10 13:33:04 +02:00
Niels Dossche
5e7783e200 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fixed not to set CR_MALFORMED_PACKET to error if CR_SERVER_GONE_ERROR is already set
2024-02-10 14:05:26 +01:00
Niels Dossche
ca60912c8f Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed not to set CR_MALFORMED_PACKET to error if CR_SERVER_GONE_ERROR is already set
2024-02-10 14:05:19 +01:00
Saki Takamachi
199e48b567 Fixed not to set CR_MALFORMED_PACKET to error if CR_SERVER_GONE_ERROR is already set
Closes GH-11951.
2024-02-10 14:04:49 +01:00
Cristian Rodríguez
927adfb1a6
Use a single version of mempcpy(3) (#12257)
While __php_mempcpy is only used by ext/standard/crypt_sha*, the
mempcpy "pattern" is used everywhere.

This commit removes __php_mempcpy, adds zend_mempcpy and transforms
open-coded parts into function calls.
2023-12-20 15:16:32 +00:00
Christoph M. Becker
c8955c078a
Revert GH-10220
Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit ecc880f491.
This reverts commit 588a07f737.
This reverts commit f377e15751.
This reverts commit b4ba16fe18.
This reverts commit 694ec1deea.
This reverts commit 6b34de8eba.
This reverts commit aa1cd02a43.
This reverts commit 308fd311ea.
This reverts commit 16203b53e1.
This reverts commit 738fb5ca54.
This reverts commit 9fdbefacd3.
This reverts commit cd4a7c1d90.
This reverts commit 928685eba2.
This reverts commit 01e5ffc85c.
2023-01-16 12:27:33 +01:00
Max Kellermann
308fd311ea ext/{standard,json,random,...}: add missing includes 2023-01-10 14:19:03 +00:00
Kamil Tekiela
3508b07bd6
Tidy up buffer preparation in mysqlnd (#9834) 2022-11-02 12:06:03 +00:00
Kamil Tekiela
646b8f6b5c
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Add NEWS entry for #9841
  Add a temporary fix for insufficient buffer size in mysqlnd (#9835)
  mysqli_query throws warning despite using silenced error mode (#9842)
2022-10-27 18:34:14 +01:00
Kamil Tekiela
ec1f58c871
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Add NEWS entry for #9841
  Add a temporary fix for insufficient buffer size in mysqlnd (#9835)
  mysqli_query throws warning despite using silenced error mode (#9842)
2022-10-27 18:31:38 +01:00
Kamil Tekiela
e713a8e8e5
Add a temporary fix for insufficient buffer size in mysqlnd (#9835) 2022-10-27 18:25:17 +01:00
Stanislav Malyshev
70d03423c7 Merge branch 'PHP-8.1' 2022-06-06 01:11:49 -06:00
Stanislav Malyshev
98e1291b7e Merge branch 'PHP-8.0' into PHP-8.1 2022-06-06 01:11:44 -06:00
Stanislav Malyshev
e864cb61a7 Merge branch 'PHP-7.4' into PHP-8.0 2022-06-06 01:11:13 -06:00
Stanislav Malyshev
58006537fc Fix bug #81719: mysqlnd/pdo password buffer overflow 2022-06-06 00:56:51 -06:00
Kamil Tekiela
2a0bc0bbfc
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix coding style from previous commit
2022-01-20 11:18:41 +00:00
Kamil Tekiela
1605e6fd9f
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix coding style from previous commit
2022-01-20 11:18:03 +00:00
Kamil Tekiela
82b883034c
Fix coding style from previous commit 2022-01-20 11:17:18 +00:00
Kamil Tekiela
262d4c220b
Merge branch 'PHP-8.1'
* PHP-8.1:
  Strip MariaDB 10 prefix
  Fix news entry for 8.1.2
2022-01-19 21:45:36 +00:00
Kamil Tekiela
1f0661d3e5
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Strip MariaDB 10 prefix
2022-01-19 21:45:19 +00:00
Kamil Tekiela
5fc0db989e
Strip MariaDB 10 prefix
Closes GH-7972
2022-01-19 21:39:42 +00:00
Christoph M. Becker
15233a47b2
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix bug where large bigints may be truncated
2021-12-30 19:11:22 +01:00
Christoph M. Becker
ae9e98640a
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix bug where large bigints may be truncated
2021-12-30 19:10:36 +01:00
NathanFreeman
b3903515bf
Fix bug where large bigints may be truncated
Unless stringified results are requested, we need to parse large
bigints as unsigned, to avoid wrap-around behavior.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-7837.
2021-12-30 19:07:36 +01:00
Dmitry Stogov
90b7bde615 Use more compact representation for packed arrays.
- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[i]
  instead of ht->arData[i]
- in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar
  familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes
  (ZEND_HASH_MAP_FOREACH_*)
- introduced an additional family of macros to access elements of array
  (packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX,
  ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT
- zend_hash_minmax() prototype was changed to compare only values

Because of smaller data set, this patch may show performance improvement
on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser)

TODO:
    - sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET).
    - zend_hash_sort_ex() may require converting packed arrays to hash.
2021-11-03 15:18:26 +03:00
Kamil Tekiela
a893a4901f
Implement mysqlnd_set_persistent_string (#7371) 2021-08-20 12:03:46 +01:00
Kamil Tekiela
d902b3a844
Replace macro with inline function (#7365) 2021-08-13 20:03:26 +01:00
Nikita Popov
b80767e219 Remove MYSQLND_SZ_T_SPEC
In favor of %zu, which msvc has supported for quite a while already.
2021-08-12 15:29:06 +02:00
Patrick Allaert
aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
Nikita Popov
57f06b6058 Fix more mysqlnd debug printf formats
These didn't show up on my system...
2021-06-16 16:23:30 +02:00
Nikita Popov
3acdab864d Fix printf formats in mysql debug logging
Enable printf format verification and fix the reported errors.
2021-06-16 16:09:06 +02:00
Nikita Popov
635303aec5 Fixed bug #80761
When row data split across multiple packets, allocate a temporary
buffer that can be reallocated, and only copy into the row buffer
pool arena once we know the final size. This avoids quadratic
memory usage for very large results.

(cherry picked from commit 1fc4c89214)
2021-05-27 16:00:03 +02:00
George Peter Banyard
aca6aefd85
Remove 'register' type qualifier (#6980)
The compiler should be smart enough to optimize this on its own
2021-05-14 13:38:01 +01:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Nikita Popov
3a867b9827 Fixed bug #80808
If the ZEROFILL flag is set for a field, do not convert it into
an integer (text protocol) or convert it explicitly into a padded
string (binary protocol).
2021-03-02 10:59:34 +01:00
Nikita Popov
fc1a012c49 Fix Windows build
Don't add to a void pointer.
2021-02-23 12:23:08 +01:00
Nikita Popov
771b0bd1df Remove free_chunk API
This API only works in very limited circumstances -- relying on
it will invariably lead to leaks. The correct way to "free" something
from the pool is to use the checkpoint API.
2021-02-23 11:46:34 +01:00
Nikita Popov
1fc4c89214 Fixed bug #80761
When row data split across multiple packets, allocate a temporary
buffer that can be reallocated, and only copy into the row buffer
pool arena once we know the final size. This avoids quadratic
memory usage for very large results.
2021-02-23 11:17:31 +01:00