Skip to content
Snippets Groups Projects
Commit 9d44f894 authored by Simon McVittie's avatar Simon McVittie
Browse files

runtime: Fix buffer underrun if version.txt is empty


Detected by AddressSanitizer (meson -Dsanitize=address,undefined).

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 602b49b6
No related branches found
No related tags found
1 merge request!37runtime: Fix buffer underrun if version.txt is empty
Pipeline #1498 passed
......@@ -234,7 +234,7 @@ _srt_runtime_check (const char *bin32,
const char *underscore = strrchr (contents, '_');
/* Remove trailing \n if any */
if (contents[len - 1] == '\n')
if (len > 0 && contents[len - 1] == '\n')
contents[--len] = '\0';
if (len != strlen (contents) ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment