Skip to content

Fix buffer overflow in file_browser.c#7

Open
bytecodesky wants to merge 1 commit intoSeraphYuki:mainfrom
bytecodesky:fix-buffer-overflow-filebrowser.c
Open

Fix buffer overflow in file_browser.c#7
bytecodesky wants to merge 1 commit intoSeraphYuki:mainfrom
bytecodesky:fix-buffer-overflow-filebrowser.c

Conversation

@bytecodesky
Copy link

Bug: file_browser.c: Stack buffer overflow via strcpy (L66, 67)

Impact: A stack-based buffer overflow can lead to memory corruption, potentially causing denial of service or arbitrary code execution.

Vulnerable Code:

		strcpy(temp,fb->directory);
		strcpy(&temp[strlen(temp)], dp->d_name);

Proposed Fix:

		snprintf(temp, MAX_PATH_LEN, "%s%s", fb->directory, dp->d_name);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant