From c6e8b680148ad6adb9737865593cb78e66ae0bb0 Mon Sep 17 00:00:00 2001 From: CCXXXI Date: Mon, 11 Jan 2021 01:51:28 +0800 Subject: [PATCH] fix bug --- src/userprog/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/userprog/syscall.c b/src/userprog/syscall.c index 9d07b77..07a1e03 100644 --- a/src/userprog/syscall.c +++ b/src/userprog/syscall.c @@ -171,7 +171,7 @@ static bool is_valid_str(const char *str) for (char *c = str; *c != '\0';) { ++c; - if (c - str + 2 == PGSIZE || (unsigned)c & PGMASK == 0 && !is_valid_ptr(c)) + if (c - str + 2 == PGSIZE || !is_valid_ptr(c)) return false; }