Tk Source Code

View Ticket
Login
Ticket UUID: d93d961dd4b5ee44e3c902366d52ea84d4c550b7
Title: Pointer arithmetic with NULL in ImgGetPhoto()
Type: Bug Version: core-8-6-branch
Submitter: chrstphrchvz Created on: 2025-08-02 09:40:36
Subsystem: 41. Photo Images Assigned To: chrstphrchvz
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2025-08-15 22:28:41
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2025-08-15 22:28:41
Description:

UBSan -fsanitize=pointer-overflow error observed for core-8-6-branch and later:

% image create photo photo1
photo1
% photo1 data
generic/tkImgPhoto.c:3798:24: runtime error: applying zero offset to null pointer

…i.e. blockPtr->pixelPtr is NULL.

(Split off from ticket [fef61fae66])

User Comments: jan.nijtmans added on 2025-08-15 22:28:41:

Fixed [61aaaad2d5fa6094|here] (and in all other active branches)

Thanks for the report!


chrstphrchvz added on 2025-08-14 17:14:42:

Jan, thanks for the proposed fix. I do not spot any issues with it.