Search Postgresql Archives

Re: Text search segmentation fault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I reproduced the bug with a help of Grzegorz's point for 64-bit box. So, patch is attached and I'm going to commit it

--
Teodor Sigaev                                   E-mail: teodor@xxxxxxxxx
                                                   WWW: http://www.sigaev.ru/
*** src/backend/tsearch/spell.c.orig	2009-01-29 18:18:03.000000000 +0300
--- src/backend/tsearch/spell.c	2009-01-29 18:20:09.000000000 +0300
***************
*** 521,527 ****
  				(errcode(ERRCODE_CONFIG_FILE_ERROR),
  				 errmsg("multibyte flag character is not allowed")));
  
! 	Conf->flagval[(unsigned int) *s] = (unsigned char) val;
  	Conf->usecompound = true;
  }
  
--- 521,527 ----
  				(errcode(ERRCODE_CONFIG_FILE_ERROR),
  				 errmsg("multibyte flag character is not allowed")));
  
! 	Conf->flagval[*(unsigned char*) s] = (unsigned char) val;
  	Conf->usecompound = true;
  }
  
***************
*** 654,660 ****
  				ptr = repl + (ptr - prepl) + 1;
  				while (*ptr)
  				{
! 					aflg |= Conf->flagval[(unsigned int) *ptr];
  					ptr++;
  				}
  			}
--- 654,660 ----
  				ptr = repl + (ptr - prepl) + 1;
  				while (*ptr)
  				{
! 					aflg |= Conf->flagval[*(unsigned char*) ptr];
  					ptr++;
  				}
  			}
***************
*** 735,741 ****
  
  				if (*s && pg_mblen(s) == 1)
  				{
! 					Conf->flagval[(unsigned int) *s] = FF_COMPOUNDFLAG;
  					Conf->usecompound = true;
  				}
  				oldformat = true;
--- 735,741 ----
  
  				if (*s && pg_mblen(s) == 1)
  				{
! 					Conf->flagval[*(unsigned char*) s] = FF_COMPOUNDFLAG;
  					Conf->usecompound = true;
  				}
  				oldformat = true;
***************
*** 791,797 ****
  						(errcode(ERRCODE_CONFIG_FILE_ERROR),
  						 errmsg("multibyte flag character is not allowed")));
  
! 			flag = (unsigned char) *s;
  			goto nextline;
  		}
  		if (STRNCMP(recoded, "COMPOUNDFLAG") == 0 || STRNCMP(recoded, "COMPOUNDMIN") == 0 ||
--- 791,797 ----
  						(errcode(ERRCODE_CONFIG_FILE_ERROR),
  						 errmsg("multibyte flag character is not allowed")));
  
! 			flag = *(unsigned char*) s;
  			goto nextline;
  		}
  		if (STRNCMP(recoded, "COMPOUNDFLAG") == 0 || STRNCMP(recoded, "COMPOUNDMIN") == 0 ||
***************
*** 851,857 ****
  
  	while (str && *str)
  	{
! 		flag |= Conf->flagval[(unsigned int) *str];
  		str++;
  	}
  
--- 851,857 ----
  
  	while (str && *str)
  	{
! 		flag |= Conf->flagval[*(unsigned char*) str];
  		str++;
  	}
  
-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux