forked from epagris/FreeRTOS-Kernel
		
	Added checks for index in ThreadLocalStorage APIs (#552)
Added checks for ( xIndex >= 0 ) in ThreadLocalStorage APIs
This commit is contained in:
		
							parent
							
								
									d91cd6fd05
								
							
						
					
					
						commit
						6324f6fc3e
					
				
							
								
								
									
										6
									
								
								tasks.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								tasks.c
									
									
									
									
									
								
							@ -3592,7 +3592,8 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
 | 
			
		||||
    {
 | 
			
		||||
        TCB_t * pxTCB;
 | 
			
		||||
 | 
			
		||||
        if( xIndex < configNUM_THREAD_LOCAL_STORAGE_POINTERS )
 | 
			
		||||
        if( ( xIndex >= 0 ) &&
 | 
			
		||||
            ( xIndex < configNUM_THREAD_LOCAL_STORAGE_POINTERS ) )
 | 
			
		||||
        {
 | 
			
		||||
            pxTCB = prvGetTCBFromHandle( xTaskToSet );
 | 
			
		||||
            configASSERT( pxTCB != NULL );
 | 
			
		||||
@ -3611,7 +3612,8 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
 | 
			
		||||
        void * pvReturn = NULL;
 | 
			
		||||
        TCB_t * pxTCB;
 | 
			
		||||
 | 
			
		||||
        if( xIndex < configNUM_THREAD_LOCAL_STORAGE_POINTERS )
 | 
			
		||||
        if( ( xIndex >= 0 ) &&
 | 
			
		||||
            ( xIndex < configNUM_THREAD_LOCAL_STORAGE_POINTERS ) )
 | 
			
		||||
        {
 | 
			
		||||
            pxTCB = prvGetTCBFromHandle( xTaskToQuery );
 | 
			
		||||
            pvReturn = pxTCB->pvThreadLocalStoragePointers[ xIndex ];
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user