mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	Avoid dereference before null check
This commit is contained in:
		| @@ -1965,7 +1965,7 @@ bool Gnuplot::get_program_path() | |||||||
|     path = std::getenv("PATH"); |     path = std::getenv("PATH"); | ||||||
|     char secured_path[4096]; |     char secured_path[4096]; | ||||||
|     size_t len = strlen(path); |     size_t len = strlen(path); | ||||||
|     if (path && len < 4046 * sizeof(char)) |     if (len > 0 && len < 4046 * sizeof(char)) | ||||||
|         { |         { | ||||||
|             strncpy(secured_path, path, sizeof(secured_path)); |             strncpy(secured_path, path, sizeof(secured_path)); | ||||||
|         } |         } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez