Bug 2228923 - Buffer Overflow Error attempting to generate a datamatrix png
Summary: Buffer Overflow Error attempting to generate a datamatrix png
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: dmtx-utils
Version: 38
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Dan Horák
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-03 16:00 UTC by Beau V.C. Bellamy
Modified: 2023-08-05 22:39 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
GDB Backtrace (1.75 KB, text/plain)
2023-08-03 16:00 UTC, Beau V.C. Bellamy
no flags Details
Proposed patch to fix buffer overflow (597 bytes, patch)
2023-08-04 01:08 UTC, Beau V.C. Bellamy
no flags Details | Diff

Description Beau V.C. Bellamy 2023-08-03 16:00:07 UTC
Created attachment 1981494 [details]
GDB Backtrace

Description of problem:
Attempting to generate a datamatrix with the dmtxwrite utility results in a buffer overflow error and termination.

Version-Release number of selected component (if applicable):
0.7.6-14.fc38

How reproducible:
[user@fedora38 ~]# cat /etc/fedora-release | dmtxwrite -o release.png
*** buffer overflow detected ***: terminated
Aborted (core dumped)


Actual results:
Crash

Expected results:
release.png image created

Additional info:
backtrace attached

Comment 1 Beau V.C. Bellamy 2023-08-04 01:08:28 UTC
Created attachment 1981565 [details]
Proposed patch to fix buffer overflow

Comment 2 Beau V.C. Bellamy 2023-08-04 01:14:11 UTC
dmtxwrite appears completely broken when _FORTIFY_SOURCE=3 is used.  The attached patch attempts to fix the source.

Comment 3 Dan Horák 2023-08-04 07:50:54 UTC
Thanks, seems _FORTIFY_SOURCE=3 is doing its work. Could you open an upstream PR (https://github.com/dmtx/dmtx-utils/pulls) as well so I can I refer it in the package?

Comment 4 Beau V.C. Bellamy 2023-08-05 22:39:07 UTC
Upstream pull request is here: [https://github.com/dmtx/dmtx-utils/pull/16](https://github.com/dmtx/dmtx-utils/pull/16)


Note You need to log in before you can comment on or make changes to this bug.