Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix GH-16322: imageaffine overflow on affine argument.#16334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
devnexen wants to merge2 commits intophp:PHP-8.2fromdevnexen:gh16322

Conversation

devnexen
Copy link
Member

No description provided.

cmb69 added a commit that referenced this pull requestOct 9, 2024
This reverts commit0511426, since itapparently has been pushed inadvertently (see PR#16334).
@devnexendevnexenforce-pushed thegh16322 branch 2 times, most recently frombc91602 to2a070dcCompareOctober 9, 2024 23:37
@devnexendevnexen marked this pull request as ready for reviewOctober 9, 2024 23:54
ext/gd/gd.c Outdated
break;
caseIS_DOUBLE:
affine[i]=Z_DVAL_P(zval_affine_elem);
if (ZEND_LONG_EXCEEDS_INT(affine[i])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think this will work on 32bit platforms, sinceZEND_LONG_EXCEEDS_INT() is a no-op there, but users can pass a matrix like[9223372036854775807., 1, 1, 1, 1, 1]. Same for theIS_STRING case below.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

you re right I always forget.

Copy link
Member

@cmb69cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you! Looks generally good to me, and I don't see any particular issues with constraining the range of the matrix elements.

caseIS_LONG:
affine[i]=Z_LVAL_P(zval_affine_elem);
affine[i]=Z_LVAL_P(zval_affine_elem);
if (affine[i]<INT_MIN||affine[i]>INT_MAX) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This guard could useZEND_LONG_EXCEEDS_INT(), but for consistency it maybe better this way (and the compiler will optimize away anyway).

--INI--
memory_limit=-1
--SKIPIF--
<?phpif (PHP_INT_SIZE !=8)die('skip this test is for 64bit platforms only');?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The test could make sense on 32bit platforms, too, if instead ofPHP_INT_MIN andPHP_INT_MAX doubles would be used.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@cmb69cmb69cmb69 approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Unexpected value in ext/gd/libgd/gd_interpolation.c:2443
2 participants
@devnexen@cmb69

[8]ページ先頭

©2009-2025 Movatter.jp