mirror of
				https://github.com/coturn/coturn.git
				synced 2025-11-04 00:41:02 +01:00 
			
		
		
		
	Fix off-by-one when terminating gcm_nonce (#1039)
The `gcm_nonce` character array is `12 + 1` chars long. Writing to `gcm_nonce[12 + 1]` overflows the array by one char.
This commit is contained in:
		
							parent
							
								
									6f14716149
								
							
						
					
					
						commit
						f488aa6921
					
				@ -337,7 +337,7 @@ int main(int argc, char **argv)
 | 
				
			|||||||
        nonce_size=OAUTH_GCM_NONCE_SIZE;
 | 
					        nonce_size=OAUTH_GCM_NONCE_SIZE;
 | 
				
			||||||
      } 
 | 
					      } 
 | 
				
			||||||
      strncpy(gcm_nonce,nonce_val,nonce_size);
 | 
					      strncpy(gcm_nonce,nonce_val,nonce_size);
 | 
				
			||||||
      gcm_nonce[ nonce_size + 1 ]='\0';
 | 
					      gcm_nonce[ nonce_size ]='\0';
 | 
				
			||||||
      break;
 | 
					      break;
 | 
				
			||||||
    case 'p':
 | 
					    case 'p':
 | 
				
			||||||
      //token-mac-key
 | 
					      //token-mac-key
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user