Skip to content

Conversation

@ellert
Copy link
Contributor

@ellert ellert commented May 4, 2025

On Linux the sizes of the sysname and machine fields are 65 bytes and the target array is large enough to hold the result of the snprintf command.

On platforms where the sizes of the fields are larger, e.g. GNY/Hurd where they are 1024 bytes, the results overflows.

src/request.c:1105:57: error: ‘%s’ directive output may be truncated writing up to 2048 bytes into a region of size between 211 and 218 [-Werror=format-truncation=]

This change does not change the size of the array on Linux: 126 + 65 + 65 = 256

On Linux the sizes of the sysname and machine fields are 65 bytes and
the target array is large enough to hold the result of the snprintf
command.

On platforms where the sizes of the fields are larger, e.g. GNY/Hurd
where they are 1024 bytes, the results overflows.

src/request.c:1105:57: error: ‘%s’ directive output may be truncated writing up to 2048 bytes into a region of size between 211 and 218 [-Werror=format-truncation=]

This change does not change the size of the array on Linux:
126 + 65 + 65 = 256
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