mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix format specifiers and arguments in com_dotnet (GH-15398)
This is mostly about minor glitches (signedness or length confusion), but also fixes two occasions where `zend_string`s still have been regarded as `char *`. We also add a regression test case for failing property name lookup, since that is the most relevant issue we're fixing here.
This commit is contained in:
parent
04320d2fba
commit
4b2dc58651
5 changed files with 31 additions and 16 deletions
|
@ -245,7 +245,7 @@ PHP_METHOD(dotnet, __construct)
|
|||
if (FAILED(hr)) {
|
||||
char buf[1024];
|
||||
char *err = php_win32_error_to_msg(hr);
|
||||
snprintf(buf, sizeof(buf), "Failed to init .Net runtime [%s] [0x%08x] %s", where, hr, err);
|
||||
snprintf(buf, sizeof(buf), "Failed to init .Net runtime [%s] [0x%08lx] %s", where, hr, err);
|
||||
php_win32_error_msg_free(err);
|
||||
php_com_throw_exception(hr, buf);
|
||||
RETURN_THROWS();
|
||||
|
@ -258,7 +258,7 @@ PHP_METHOD(dotnet, __construct)
|
|||
if (FAILED(hr)) {
|
||||
char buf[1024];
|
||||
char *err = php_win32_error_to_msg(hr);
|
||||
snprintf(buf, sizeof(buf), "Failed to re-init .Net domain [%s] [0x%08x] %s", where, hr, err);
|
||||
snprintf(buf, sizeof(buf), "Failed to re-init .Net domain [%s] [0x%08lx] %s", where, hr, err);
|
||||
php_win32_error_msg_free(err);
|
||||
php_com_throw_exception(hr, buf);
|
||||
ZVAL_NULL(object);
|
||||
|
@ -270,7 +270,7 @@ PHP_METHOD(dotnet, __construct)
|
|||
if (FAILED(hr)) {
|
||||
char buf[1024];
|
||||
char *err = php_win32_error_to_msg(hr);
|
||||
snprintf(buf, sizeof(buf), "Failed to re-init .Net domain [%s] [0x%08x] %s", where, hr, err);
|
||||
snprintf(buf, sizeof(buf), "Failed to re-init .Net domain [%s] [0x%08lx] %s", where, hr, err);
|
||||
php_win32_error_msg_free(err);
|
||||
php_com_throw_exception(hr, buf);
|
||||
ZVAL_NULL(object);
|
||||
|
@ -344,7 +344,7 @@ PHP_METHOD(dotnet, __construct)
|
|||
if (ret == FAILURE) {
|
||||
char buf[1024];
|
||||
char *err = php_win32_error_to_msg(hr);
|
||||
snprintf(buf, sizeof(buf), "Failed to instantiate .Net object [%s] [0x%08x] %s", where, hr, err);
|
||||
snprintf(buf, sizeof(buf), "Failed to instantiate .Net object [%s] [0x%08lx] %s", where, hr, err);
|
||||
php_win32_error_msg_free(err);
|
||||
php_com_throw_exception(hr, buf);
|
||||
RETURN_THROWS();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue