Changeset bded3f05 in rtems


Ignore:
Timestamp:
Jul 24, 2018, 10:46:32 AM (16 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
bf199e0c
Parents:
001b9925
git-author:
Sebastian Huber <sebastian.huber@…> (07/24/18 10:46:32)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/24/18 11:00:55)
Message:

psxthreadname01: Fix out of bounds memory access

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/psxthreadname01/init.c

    r001b9925 rbded3f05  
    3636  int eno;
    3737
    38   memcpy(name, no_name, sizeof(name));
     38  memcpy(name, no_name, sizeof(no_name));
    3939  eno = pthread_getname_np(0xffffffff, name, MAX_NAME_SIZE);
    4040  rtems_test_assert(eno == ESRCH);
     
    4444  rtems_test_assert(eno == ESRCH);
    4545
    46   memcpy(name, no_name, sizeof(name));
     46  memcpy(name, no_name, sizeof(no_name));
    4747  eno = pthread_getname_np(pthread_self(), name, 0);
    4848  rtems_test_assert(eno == ERANGE);
    4949  rtems_test_assert(strcmp(name, "NO") == 0);
    5050
    51   memcpy(name, no_name, sizeof(name));
     51  memcpy(name, no_name, sizeof(no_name));
    5252  eno = pthread_getname_np(pthread_self(), name, sizeof(name));
    5353  rtems_test_assert(eno == 0);
     
    5757  rtems_test_assert(eno == ERANGE);
    5858
    59   memcpy(name, no_name, sizeof(name));
     59  memcpy(name, no_name, sizeof(no_name));
    6060  eno = pthread_getname_np(pthread_self(), name, sizeof(name));
    6161  rtems_test_assert(eno == 0);
     
    6565  rtems_test_assert(eno == 0);
    6666
    67   memcpy(name, no_name, sizeof(name));
     67  memcpy(name, no_name, sizeof(no_name));
    6868  eno = pthread_getname_np(pthread_self(), name, sizeof(name));
    6969  rtems_test_assert(eno == 0);
    7070  rtems_test_assert(strcmp(name, "new") == 0);
    7171
    72   memcpy(name, no_name, sizeof(name));
     72  memcpy(name, no_name, sizeof(no_name));
    7373  eno = pthread_getname_np(pthread_self(), name, 3);
    7474  rtems_test_assert(eno == ERANGE);
Note: See TracChangeset for help on using the changeset viewer.