mirror of
https://github.com/drasko/codezero.git
synced 2026-01-24 16:53:14 +01:00
Fixed omission of if curly brackets causing stack corruption.
Initialization a local pointer variable was only done in some conditions causing the uninitialized pointer to corrupt kernel stack of current.
This commit is contained in:
@@ -17,10 +17,11 @@ int forktest(void)
|
||||
|
||||
|
||||
/* 16 forks */
|
||||
for (int i = 0; i < 4; i++)
|
||||
for (int i = 0; i < 4; i++) {
|
||||
test_printf("%d: Forking...\n", getpid());
|
||||
if (fork() < 0)
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
myid = getpid();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user