[PATCH 02/10] top/task1.c: Fix sprintf() buffer overflow

Gedare Bloom gedare at rtems.org
Thu Jun 22 14:54:56 UTC 2017


On Thu, Jun 22, 2017 at 10:53 AM, Gedare Bloom <gedare at rtems.org> wrote:
> On Wed, Jun 21, 2017 at 1:52 PM, Joel Sherrill <joel at rtems.org> wrote:
>> ---
>>  testsuites/libtests/top/task1.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/testsuites/libtests/top/task1.c b/testsuites/libtests/top/task1.c
>> index fc81f51..c9e62df 100644
>> --- a/testsuites/libtests/top/task1.c
>> +++ b/testsuites/libtests/top/task1.c
>> @@ -28,7 +28,7 @@ static void create_and_start( uint32_t i )
>>  {
>>    rtems_status_code status;
>>    char              str[30];
>> -  char              name[5];
>> +  char              name[6];
>>
>>    sprintf(name, "TA%02" PRId32 " ", i);
>
> Do you know that i < 10?
Nevermind, I misread this. Looks good.

>
>>
>> --
>> 1.8.3.1
>>
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list