Opened 3 months ago

Closed 3 months ago

#14320 closed bug (fixed)

Accelerants: Fix -Wformat-overflow

Reported by: mt Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Drivers/Graphics Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

https://review.haiku-os.org/#/c/haiku/+/429/

Use strlcpy() and strlcat() instead of sprintf() in mga and nv accelerants, since gcc8 warns -Werror=format-overflow= to sprintf() like below.

/home/haiku/haiku/haiku/src/add-ons/accelerants/matrox/engine/mga_crtc.c:299:19: error: 'display off, ' directive writing 13 bytes into a region of size between 1 and 100 [-Werror=format-overflow=]
   sprintf(msg, "%sdisplay off, ", msg);
                   ^~~~~~~~~~~~~
/home/haiku/haiku/haiku/src/add-ons/accelerants/matrox/engine/mga_crtc.c:299:3: note: 'sprintf' output between 14 and 113 bytes into a destination of size 100
   sprintf(msg, "%sdisplay off, ", msg);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Attachments (1)

accelerants_buildlog.txt (20.5 KB) - added by mt 3 months ago.

Download all attachments as: .zip

Change History (3)

Changed 3 months ago by mt

Attachment: accelerants_buildlog.txt added

comment:1 Changed 3 months ago by waddlesplash

You don't need to create Trac tickets for these patches; they're small enough that submitting only to Gerrit is fine. :)

comment:2 Changed 3 months ago by waddlesplash

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.