Skip to content

fix sprintf overflow#1

Open
zviratko wants to merge 1 commit intoC5Lab:mainfrom
zviratko:main
Open

fix sprintf overflow#1
zviratko wants to merge 1 commit intoC5Lab:mainfrom
zviratko:main

Conversation

@zviratko
Copy link
Copy Markdown

@zviratko zviratko commented Apr 2, 2026

fixes the following by truncating lat/lon to 14b, should be more than enough

applications_user/flipperLight/src/screen_wardrive.c: In function 'wardrive_parse_fix_coords.constprop':
applications_user/flipperLight/src/screen_wardrive.c:180:36: error: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=]
  180 |     snprintf(out, out_size, "%s, %s", lat, lon);
      |                                    ^
applications_user/flipperLight/src/screen_wardrive.c:180:5: note: 'snprintf' output between 3 and 33 bytes into a destination of size 32
  180 |     snprintf(out, out_size, "%s, %s", lat, lon);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
    LINK    build/f7-firmware-C/.extapps/cli_bt_d.elf
scons: *** [build/f7-firmware-C/.extapps/c5lab_dev/src/screen_wardrive.o] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant