From: arighi Date: Wed, 17 Mar 2010 18:31:05 +0000 (+0000) Subject: proc_test: fix buffer overflow. X-Git-Tag: 2.4.0~32 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=f04b11589eb9bff739ac3e33a4c74ed5a4504fe7;p=bertos.git proc_test: fix buffer overflow. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3232 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/kern/proc_test.c b/bertos/kern/proc_test.c index 46a057f4..ebb16062 100644 --- a/bertos/kern/proc_test.c +++ b/bertos/kern/proc_test.c @@ -127,7 +127,7 @@ static int worker_test(void) { name[i][0] = '\0'; snprintf(&name[i][0], sizeof(name[i]), "worker_%zd", i + 1); - name[i][sizeof(name) - 1] = '\0'; + name[i][sizeof(name[i]) - 1] = '\0'; proc_new_with_name(name[i], worker, (iptr_t)(i + 1), WORKER_STACK_SIZE, (cpu_stack_t *)((size_t)&worker_stack + WORKER_STACK_SIZE * i)); @@ -204,7 +204,7 @@ static int preempt_worker_test(void) name[i][0] = '\0'; snprintf(&name[i][0], sizeof(name[i]), "preempt_worker_%zd", i + 1); - name[i][sizeof(name) - 1] = '\0'; + name[i][sizeof(name[i]) - 1] = '\0'; proc_new_with_name(name[i], preempt_worker, (iptr_t)(i + 1), WORKER_STACK_SIZE, (cpu_stack_t *)((size_t)&worker_stack + WORKER_STACK_SIZE * i));