1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 10:35:10 +00:00

Avoid passing null pointer to strncpy

This commit is contained in:
Mithil Poojary 2020-10-03 03:21:38 +05:30 committed by Brenden Matthews
parent a9ecfbaae5
commit 87a31ba039

View File

@ -131,7 +131,9 @@ static void mbox_scan(char *args, char *output, size_t max_len) {
tmp = strtok(nullptr, " ");
if (tmp != nullptr) { start = tmp; }
}
strncpy(mbox_mail_spool, start, DEFAULT_TEXT_BUFFER_SIZE);
if (start != nullptr) {
strncpy(mbox_mail_spool, start, DEFAULT_TEXT_BUFFER_SIZE);
}
free(copy_args);
}
if (strlen(mbox_mail_spool) < 1) {