Changeset 2b596c69 in rtems


Ignore:
Timestamp:
Jul 6, 2007, 9:11:36 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
2c0f748
Parents:
8ddf67e
Message:

2007-07-06 Joel Sherrill <joel.sherrill@…>

  • libmisc/stackchk/check.c: Make checking the integrity of the pattern area contingent on the stack checker user extension having been initialized.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r8ddf67e r2b596c69  
     12007-07-06      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * libmisc/stackchk/check.c: Make checking the integrity of the pattern
     4        area contingent on the stack checker user extension having been
     5        initialized.
     6
    172007-06-21      Joel Sherrill <joel.sherrill@OARcorp.com>
    28
  • cpukit/libmisc/stackchk/check.c

    r8ddf67e r2b596c69  
    267267
    268268  /*
    269    *  Check for an out of bounds stack pointer and then an overwrite
    270    */
    271 
     269   *  Check for an out of bounds stack pointer or an overwrite
     270   */
    272271  sp_ok = Stack_check_Frame_pointer_in_range( the_stack );
     272
    273273  pattern_ok = (!memcmp( pattern,
    274274            (void *) Stack_check_Pattern.pattern, PATTERN_SIZE_BYTES));
     
    285285{
    286286  Stack_Control *the_stack = &_Thread_Executing->Start.Initial_stack;
    287   void          *pattern;
    288287  boolean        sp_ok;
    289288  boolean        pattern_ok = TRUE;
    290289
    291   pattern = (void *) Stack_check_Get_pattern_area(the_stack)->pattern;
    292 
    293   /*
    294    *  Check for an out of bounds stack pointer and then an overwrite
     290  /*
     291   *  Check for an out of bounds stack pointer
    295292   */
    296293
    297294  sp_ok = Stack_check_Frame_pointer_in_range( the_stack );
    298   pattern_ok = (!memcmp( pattern,
    299             (void *) Stack_check_Pattern.pattern, PATTERN_SIZE_BYTES));
     295
     296  /*
     297   * The stack checker must be initialized before the pattern is there
     298   * to check.
     299   */
     300  if ( Stack_check_Initialized ) {
     301    pattern_ok = (!memcmp(
     302      (void *) Stack_check_Get_pattern_area(the_stack)->pattern,
     303      (void *) Stack_check_Pattern.pattern,
     304      PATTERN_SIZE_BYTES
     305    ));
     306  }
    300307
    301308  if ( !sp_ok || !pattern_ok ) {
Note: See TracChangeset for help on using the changeset viewer.