fix buffer overflow

Closes #241
This commit is contained in:
Louis Bettens 2023-09-22 20:59:19 +02:00
parent c11c487711
commit ade2edc84f
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -696,7 +696,7 @@ void get_info(struct flags flags, struct info* user_info) {
if (!tmp_shell)
sprintf(user_info->shell, "%s", "");
else
sprintf(user_info->shell, "%s", tmp_shell);
snprintf(user_info->shell, sizeof user_info->shell, "%s", tmp_shell);
#ifdef __linux__
if (strlen(user_info->shell) > 16) // android shell name was too long
memmove(&user_info->shell, &user_info->shell[27], strlen(user_info->shell));