diff options
| author | Pádraig Brady <P@draigBrady.com> | 2025-01-15 17:42:55 +0000 |
|---|---|---|
| committer | Pádraig Brady <P@draigBrady.com> | 2025-01-15 17:42:55 +0000 |
| commit | d60e550ed0ba67455a5952fe8adf27dacf47e680 (patch) | |
| tree | 5c67ca83a21be2259f48f13fe2cd4df357dc4d75 | |
| parent | tests: avoid ERRORs with no mntent.h (diff) | |
| download | coreutils-d60e550ed0ba67455a5952fe8adf27dacf47e680.tar.gz coreutils-d60e550ed0ba67455a5952fe8adf27dacf47e680.zip | |
tac: avoid out of bounds access
This was flagged on CheriBSD on ARM Morello with the error:
"In-address space security exception (core dumped)"
triggered with: tac -s '' /dev/null
* src/tac.c (main): Ensure we don't read beyond the
end of the supplied optarg.
| -rw-r--r-- | src/tac.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -553,7 +553,7 @@ main (int argc, char **argv) G_buffer = xmalloc (G_buffer_size); if (sentinel_length) { - memcpy (G_buffer, separator, sentinel_length + 1); + memcpy (G_buffer, separator, sentinel_length + !!*separator); G_buffer += sentinel_length; } else |
