[PR #561] [MERGED] Fix buffer size truncation for non-8-aligned image dimensions #1105

Closed
opened 2026-03-20 18:15:16 +01:00 by sascha_hemi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/OpenEPaperLink/OpenEPaperLink/pull/561
Author: @NickWaterton
Created: 3/13/2026
Status: Merged
Merged: 3/13/2026
Merged by: @skiphansen

Base: masterHead: makeimage-bufsize-fix


📝 Commits (1)

  • 07de232 Fix buffer size truncation for non-8-aligned image dimensions

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 ESP32_AP-Flasher/src/makeimage.cpp (+2 -2)

📄 Description

Integer division (wh)/8 truncates when wh is not a multiple of 8, allocating one byte too few. spr2color then writes past the end of the buffer, corrupting the heap. Use (w*h+7)/8 to round up correctly.

Triggered by any tag whose width*height is not divisible by 8.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/OpenEPaperLink/OpenEPaperLink/pull/561 **Author:** [@NickWaterton](https://github.com/NickWaterton) **Created:** 3/13/2026 **Status:** ✅ Merged **Merged:** 3/13/2026 **Merged by:** [@skiphansen](https://github.com/skiphansen) **Base:** `master` ← **Head:** `makeimage-bufsize-fix` --- ### 📝 Commits (1) - [`07de232`](https://github.com/OpenEPaperLink/OpenEPaperLink/commit/07de23212471e31b7b59db5fb285714334502e15) Fix buffer size truncation for non-8-aligned image dimensions ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `ESP32_AP-Flasher/src/makeimage.cpp` (+2 -2) </details> ### 📄 Description Integer division (w*h)/8 truncates when w*h is not a multiple of 8, allocating one byte too few. spr2color then writes past the end of the buffer, corrupting the heap. Use (w*h+7)/8 to round up correctly. Triggered by any tag whose width*height is not divisible by 8. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
sascha_hemi added the pull-request label 2026-03-20 18:15:16 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/OpenEPaperLink#1105