Skip to content

Fix heap buffer overflow in cv::PngDecoder::read_from_io#26700

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
vrabaud:png_buffer_overflow
Jan 3, 2025
Merged

Fix heap buffer overflow in cv::PngDecoder::read_from_io#26700
asmorkalov merged 1 commit intoopencv:4.xfrom
vrabaud:png_buffer_overflow

Conversation

@vrabaud
Copy link
Copy Markdown
Contributor

@vrabaud vrabaud commented Jan 2, 2025

If the condition is not fixed, the memcpy below can do an out of boundary read

Bug: oss-fuzz:386688710

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@vrabaud vrabaud requested a review from asmorkalov January 2, 2025 13:52
@vrabaud vrabaud added this to the 4.11.0 milestone Jan 2, 2025
@vrabaud vrabaud force-pushed the png_buffer_overflow branch from 95eb06c to 12963ea Compare January 2, 2025 14:23
@asmorkalov asmorkalov merged commit 5e1eed5 into opencv:4.x Jan 3, 2025
@asmorkalov asmorkalov self-assigned this Jan 3, 2025
@asmorkalov asmorkalov added the bug label Jan 3, 2025
@vrabaud vrabaud deleted the png_buffer_overflow branch January 3, 2025 07:59
@asmorkalov asmorkalov mentioned this pull request Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants