Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

fix buffer overflow #242

Merged
merged 1 commit into from
Sep 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down