mirror of
https://github.com/drasko/codezero.git
synced 2026-01-18 13:53:16 +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:
@@ -3,7 +3,7 @@
|
||||
|
||||
#define __TASKNAME__ "test0"
|
||||
|
||||
#define TEST_VERBOSE_PRINT
|
||||
//#define TEST_VERBOSE_PRINT
|
||||
#if defined (TEST_VERBOSE_PRINT)
|
||||
#define test_printf(...) printf(__VA_ARGS__)
|
||||
#else
|
||||
|
||||
@@ -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