Skip to content

Commit 1009ff6

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Upgrade security branches to Ubuntu 22.04
2 parents 9256ee7 + 5fcc8d4 commit 1009ff6

File tree

10 files changed

+72
-10
lines changed

10 files changed

+72
-10
lines changed

.github/scripts/setup-slapd.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
set -ex
2+
set -e
33

44
# Create TLS certificate
55
sudo mkdir -p /etc/ldap/ssl
@@ -42,7 +42,9 @@ sudo sed -e 's|^\s*SLAPD_SERVICES\s*=.*$|SLAPD_SERVICES="ldap:/// ldaps:/// ldap
4242
# Configure LDAP database.
4343
DBDN=`sudo ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config '(&(olcRootDN=*)(olcSuffix=*))' dn | grep -i '^dn:' | sed -e 's/^dn:\s*//'`;
4444

45-
sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/ppolicy.ldif
45+
if test -f "/etc/ldap/schema/ppolicy.ldif"; then
46+
sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/ppolicy.ldif
47+
fi
4648

4749
sudo ldapmodify -Q -Y EXTERNAL -H ldapi:/// << EOF
4850
dn: $DBDN

.github/workflows/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
- debug: false
7070
zts: true
7171
name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
72-
runs-on: ubuntu-20.04
72+
runs-on: ubuntu-22.04
7373
steps:
7474
- name: git checkout
7575
uses: actions/checkout@v4

.github/workflows/root.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
with:
4949
asan_ubuntu_version: ${{
5050
(((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 5) || matrix.branch.version[0] >= 9) && '24.04')
51-
|| '20.04' }}
51+
|| '22.04' }}
5252
branch: ${{ matrix.branch.ref }}
5353
community_verify_type_inference: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }}
5454
libmysqlclient_with_mysqli: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] == 1) }}
@@ -57,8 +57,7 @@ jobs:
5757
run_macos_arm64: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }}
5858
ubuntu_version: ${{
5959
(((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 5) || matrix.branch.version[0] >= 9) && '24.04')
60-
|| ((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 3) && '22.04')
61-
|| '20.04' }}
60+
|| '22.04' }}
6261
windows_version: ${{ ((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9) && '2022' || '2019' }}
6362
skip_symfony: ${{ matrix.branch.version[0] == 8 && matrix.branch.version[1] == 1 }}
6463
skip_wordpress: ${{ matrix.branch.version[0] == 8 && matrix.branch.version[1] == 1 }}

Zend/zend_portability.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,4 +698,28 @@ extern "C++" {
698698
# define ZEND_INDIRECT_RETURN
699699
#endif
700700

701+
#define __ZEND_DO_PRAGMA(x) _Pragma(#x)
702+
#define _ZEND_DO_PRAGMA(x) __ZEND_DO_PRAGMA(x)
703+
#if defined(__clang__)
704+
# define ZEND_DIAGNOSTIC_IGNORED_START(warning) \
705+
_Pragma("clang diagnostic push") \
706+
_ZEND_DO_PRAGMA(clang diagnostic ignored warning)
707+
# define ZEND_DIAGNOSTIC_IGNORED_END \
708+
_Pragma("clang diagnostic pop")
709+
#elif defined(__GNUC__)
710+
# define ZEND_DIAGNOSTIC_IGNORED_START(warning) \
711+
_Pragma("GCC diagnostic push") \
712+
_ZEND_DO_PRAGMA(GCC diagnostic ignored warning)
713+
# define ZEND_DIAGNOSTIC_IGNORED_END \
714+
_Pragma("GCC diagnostic pop")
715+
#else
716+
# define ZEND_DIAGNOSTIC_IGNORED_START(warning)
717+
# define ZEND_DIAGNOSTIC_IGNORED_END
718+
#endif
719+
720+
/** @deprecated */
721+
#define ZEND_CGG_DIAGNOSTIC_IGNORED_START ZEND_DIAGNOSTIC_IGNORED_START
722+
/** @deprecated */
723+
#define ZEND_CGG_DIAGNOSTIC_IGNORED_END ZEND_DIAGNOSTIC_IGNORED_END
724+
701725
#endif /* ZEND_PORTABILITY_H */

ext/imap/php_imap.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,11 +525,9 @@ PHP_RINIT_FUNCTION(imap)
525525
}
526526
/* }}} */
527527

528-
/* {{{ PHP_RSHUTDOWN_FUNCTION */
529-
PHP_RSHUTDOWN_FUNCTION(imap)
528+
static void free_errorlist(void)
530529
{
531530
ERRORLIST *ecur = NIL;
532-
STRINGLIST *acur = NIL;
533531

534532
if (IMAPG(imap_errorstack) != NIL) {
535533
/* output any remaining errors at their original error level */
@@ -545,6 +543,11 @@ PHP_RSHUTDOWN_FUNCTION(imap)
545543
mail_free_errorlist(&IMAPG(imap_errorstack));
546544
IMAPG(imap_errorstack) = NIL;
547545
}
546+
}
547+
548+
static void free_stringlist(void)
549+
{
550+
STRINGLIST *acur = NIL;
548551

549552
if (IMAPG(imap_alertstack) != NIL) {
550553
/* output any remaining alerts at E_NOTICE level */
@@ -560,6 +563,13 @@ PHP_RSHUTDOWN_FUNCTION(imap)
560563
mail_free_stringlist(&IMAPG(imap_alertstack));
561564
IMAPG(imap_alertstack) = NIL;
562565
}
566+
}
567+
568+
/* {{{ PHP_RSHUTDOWN_FUNCTION */
569+
PHP_RSHUTDOWN_FUNCTION(imap)
570+
{
571+
free_errorlist();
572+
free_stringlist();
563573
return SUCCESS;
564574
}
565575
/* }}} */

ext/imap/php_imap.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
# endif
4848

4949
/* these are used for quota support */
50+
ZEND_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
5051
# include "c-client.h" /* includes mail.h and rfc822.h */
52+
ZEND_DIAGNOSTIC_IGNORED_END
5153
# include "imap4r1.h" /* location of c-client quota functions */
5254
#else
5355
# include "mail.h"

ext/oci8/php_oci8_int.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353
/* }}} */
5454

5555
#include "ext/standard/php_string.h"
56+
ZEND_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
5657
#include <oci.h>
58+
ZEND_DIAGNOSTIC_IGNORED_END
5759

5860
#if !defined(OCI_MAJOR_VERSION) || OCI_MAJOR_VERSION < 11 || ((OCI_MAJOR_VERSION == 11) && (OCI_MINOR_VERSION < 2))
5961
#error This version of PHP OCI8 requires Oracle Client libraries from 11.2 or later.

ext/opcache/jit/dynasm/dasm_x86.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,14 @@ void dasm_free(Dst_DECL)
124124
void dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl)
125125
{
126126
dasm_State *D = Dst_REF;
127+
#ifdef __GNUC__
128+
# pragma GCC diagnostic push
129+
# pragma GCC diagnostic ignored "-Warray-bounds"
130+
#endif
127131
D->globals = gl - 10; /* Negative bias to compensate for locals. */
132+
#ifdef __GNUC__
133+
# pragma GCC diagnostic pop
134+
#endif
128135
DASM_M_GROW(Dst, int, D->lglabels, D->lgsize, (10+maxgl)*sizeof(int));
129136
}
130137

ext/pdo_oci/php_pdo_oci_int.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@
1414
+----------------------------------------------------------------------+
1515
*/
1616

17+
#ifndef PHP_PDO_OCI_INT_H
18+
#define PHP_PDO_OCI_INT_H
19+
20+
#include "zend_portability.h"
21+
22+
ZEND_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
1723
#include <oci.h>
24+
ZEND_DIAGNOSTIC_IGNORED_END
1825

1926
typedef struct {
2027
const char *file;
@@ -105,3 +112,5 @@ enum {
105112
PDO_OCI_ATTR_MODULE,
106113
PDO_OCI_ATTR_CALL_TIMEOUT
107114
};
115+
116+
#endif /* PHP_PDO_OCI_INT_H */

ext/soap/php_encoding.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2399,7 +2399,14 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
23992399
if (style == SOAP_ENCODED) {
24002400
if (soap_version == SOAP_1_1) {
24012401
smart_str_0(&array_type);
2402-
if (strcmp(ZSTR_VAL(array_type.s),"xsd:anyType") == 0) {
2402+
#if defined(__GNUC__) && __GNUC__ >= 11
2403+
ZEND_DIAGNOSTIC_IGNORED_START("-Wstringop-overread")
2404+
#endif
2405+
bool is_xsd_any_type = strcmp(ZSTR_VAL(array_type.s),"xsd:anyType") == 0;
2406+
#if defined(__GNUC__) && __GNUC__ >= 11
2407+
ZEND_DIAGNOSTIC_IGNORED_END
2408+
#endif
2409+
if (is_xsd_any_type) {
24032410
smart_str_free(&array_type);
24042411
smart_str_appendl(&array_type,"xsd:ur-type",sizeof("xsd:ur-type")-1);
24052412
}

0 commit comments

Comments
 (0)