mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Make fill_missing_tank_pressures robust against missing cylinder info
The code iterates over a list that can be NULL, but happily dereferenced it anyway. Oops. This function really should be split up and commented more. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
		
							parent
							
								
									1a05f34ae8
								
							
						
					
					
						commit
						52c3d11d2c
					
				
					 1 changed files with 11 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -1049,6 +1049,7 @@ static void fill_missing_tank_pressures(struct plot_info *pi, pr_track_t **track
 | 
			
		|||
				/* there may be multiple segments - so
 | 
			
		||||
				 * let's assemble the length */
 | 
			
		||||
				nlist = list;
 | 
			
		||||
				if (list) {
 | 
			
		||||
					pt = list->pressure_time;
 | 
			
		||||
					while (!nlist->end) {
 | 
			
		||||
						nlist = nlist->next;
 | 
			
		||||
| 
						 | 
				
			
			@ -1060,6 +1061,7 @@ static void fill_missing_tank_pressures(struct plot_info *pi, pr_track_t **track
 | 
			
		|||
						}
 | 
			
		||||
						pt += nlist->pressure_time;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				if (!nlist) {
 | 
			
		||||
					/* just continue without calculating
 | 
			
		||||
					 * interpolated values */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue