Opened 6 years ago

Closed 6 years 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:
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 6 years ago.

Download all attachments as: .zip

Change History (3)

by mt, 6 years ago

Attachment: accelerants_buildlog.txt added

comment:1 by waddlesplash, 6 years ago

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

comment:2 by waddlesplash, 6 years ago

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