Changeset fbafb8f2 in rtems


Ignore:
Timestamp:
11/19/14 20:46:43 (9 years ago)
Author:
Josh Oguin <josh.oguin@…>
Branches:
4.11, 5, master
Children:
c562d0c
Parents:
e106aa73
git-author:
Josh Oguin <josh.oguin@…> (11/19/14 20:46:43)
git-committer:
Joel Sherrill <joel.sherrill@…> (11/26/14 13:51:59)
Message:

chainimpl.h: Add _Assert() to _Chain_Initialize_empty()

CodeSonar? flagged this as a potential NULL deference. That should never
occur but adding the _Assert() ensures we are checking that.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/chainimpl.h

    re106aa73 rfbafb8f2  
    88 *  Copyright (c) 2010 embedded brains GmbH.
    99 *
    10  *  COPYRIGHT (c) 1989-2006.
     10 *  COPYRIGHT (c) 1989-2014.
    1111 *  On-Line Applications Research Corporation (OAR).
    1212 *
     
    2121#include <rtems/score/chain.h>
    2222#include <rtems/score/address.h>
     23#include <rtems/score/assert.h>
    2324
    2425#ifdef __cplusplus
     
    614615)
    615616{
    616   Chain_Node *head = _Chain_Head( the_chain );
    617   Chain_Node *tail = _Chain_Tail( the_chain );
     617  Chain_Node *head;
     618  Chain_Node *tail;
     619
     620  _Assert( the_chain != NULL );
     621
     622  head = _Chain_Head( the_chain );
     623  tail = _Chain_Tail( the_chain );
    618624
    619625  head->next = tail;
Note: See TracChangeset for help on using the changeset viewer.