diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-06-18 15:56:07 +0200 |
---|---|---|
committer | Evgeny Vereshchagin <evvers@ya.ru> | 2019-06-18 20:53:46 +0300 |
commit | d9adc8a8636f48e7f33371fc97cf9388744ff3a1 (patch) | |
tree | 02f50cf3531004bd81dca8177399a68e4dc43826 /src/journal | |
parent | 1faba68fd76ca0df5ac8b51320488aea11db2f20 (diff) | |
download | systemd-d9adc8a8636f48e7f33371fc97cf9388744ff3a1.tar.gz systemd-d9adc8a8636f48e7f33371fc97cf9388744ff3a1.tar.bz2 systemd-d9adc8a8636f48e7f33371fc97cf9388744ff3a1.zip |
journald: use memdup_suffix0() when copying string from potentially binary data
Fixes: #12484
Diffstat (limited to 'src/journal')
-rw-r--r-- | src/journal/journald-native.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c index 4efe34c664..73a96da9f7 100644 --- a/src/journal/journald-native.c +++ b/src/journal/journald-native.c @@ -63,7 +63,7 @@ static void server_process_entry_meta( startswith(p, "SYSLOG_IDENTIFIER=")) { char *t; - t = strndup(p + 18, l - 18); + t = memdup_suffix0(p + 18, l - 18); if (t) { free(*identifier); *identifier = t; @@ -73,7 +73,7 @@ static void server_process_entry_meta( startswith(p, "MESSAGE=")) { char *t; - t = strndup(p + 8, l - 8); + t = memdup_suffix0(p + 8, l - 8); if (t) { free(*message); *message = t; |