mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Fix backend crash in parsing incorrect tsquery.
Per report from Jon Rosebaugh <jon@inklesspen.com>
This commit is contained in:
		@@ -144,12 +144,14 @@ gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, int2
 | 
				
			|||||||
				{
 | 
									{
 | 
				
			||||||
					(state->buf)++;
 | 
										(state->buf)++;
 | 
				
			||||||
					*val = (int4) '!';
 | 
										*val = (int4) '!';
 | 
				
			||||||
 | 
										state->state = WAITOPERAND;
 | 
				
			||||||
					return OPR;
 | 
										return OPR;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				else if (*(state->buf) == '(')
 | 
									else if (*(state->buf) == '(')
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					state->count++;
 | 
										state->count++;
 | 
				
			||||||
					(state->buf)++;
 | 
										(state->buf)++;
 | 
				
			||||||
 | 
										state->state = WAITOPERAND;
 | 
				
			||||||
					return OPEN;
 | 
										return OPEN;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				else if (*(state->buf) == ':')
 | 
									else if (*(state->buf) == ':')
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user