Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed buffer overflow in printint #299

Open
wants to merge 2 commits into
base: riscv
Choose a base branch
from
Open
Show file tree
Hide file tree
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 kernel/printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static char digits[] = "0123456789abcdef";
static void
printint(long long xx, int base, int sign)
{
char buf[16];
char buf[20];
int i;
unsigned long long x;

Expand Down
4 changes: 2 additions & 2 deletions user/printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ putc(int fd, char c)
}

static void
printint(int fd, int xx, int base, int sgn)
printint(int fd, long long xx, int base, int sgn)
{
char buf[16];
char buf[20];
int i, neg;
uint x;

Expand Down