Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updates

  • Loading branch information...
commit 0221c31a522c88dfadad4c91e76ed8fd4ffa44cf 1 parent df37172
@Frankencelery Frankencelery authored
Showing with 8 additions and 2 deletions.
  1. +7 −1 src/userprog/exception.c
  2. +1 −1  src/userprog/syscall.c
View
8 src/userprog/exception.c
@@ -151,7 +151,13 @@ page_fault (struct intr_frame *f)
/* Handle bad dereferences from system call implementation. */
/* add code */
-
+ /* Handle bad dereferences from system call implementation. */
+ if (!user)
+ {
+ f->eip = (void (*) (void)) f->eax;
+ f->eax = 0;
+ return;
+ }
/* To implement virtual memory, delete the rest of the function
body, and replace it with code that brings in the page to
View
2  src/userprog/syscall.c
@@ -212,7 +212,7 @@ static int
sys_create (const char *ufile, unsigned initial_size)
{
bool sucess = false;
- if(ufile==NULL)
+ if(ufile==NULL || !verify_user(ufile))
{
//close the program
sys_exit(-1);
Please sign in to comment.
Something went wrong with that request. Please try again.