mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Fix potential memory access violation in ecpg if filename of include file is
shorter than 2 characters. Patch by: "Wu, Fei" <wufei.fnst@cn.fujitsu.com>
This commit is contained in:
		@@ -1394,7 +1394,7 @@ parse_include(void)
 | 
				
			|||||||
		yyin = fopen(inc_file, "r");
 | 
							yyin = fopen(inc_file, "r");
 | 
				
			||||||
		if (!yyin)
 | 
							if (!yyin)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			if (strcmp(inc_file + strlen(inc_file) - 2, ".h") != 0)
 | 
								if (strlen(inc_file) <= 2 || strcmp(inc_file + strlen(inc_file) - 2, ".h") != 0)
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				strcat(inc_file, ".h");
 | 
									strcat(inc_file, ".h");
 | 
				
			||||||
				yyin = fopen(inc_file, "r");
 | 
									yyin = fopen(inc_file, "r");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user