Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb5b3134

Browse files
committed
Fix incorrect dereferencing of char* to array's index.
Per Tommy Gildseth <tommy.gildseth@usit.uio.no> report
1 parent7adbd76 commitb5b3134

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎src/backend/tsearch/spell.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/tsearch/spell.c,v 1.14 2009/01/01 17:23:48 momjian Exp $
10+
* $PostgreSQL: pgsql/src/backend/tsearch/spell.c,v 1.15 2009/01/29 16:22:10 teodor Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -521,7 +521,7 @@ addFlagValue(IspellDict *Conf, char *s, uint32 val)
521521
(errcode(ERRCODE_CONFIG_FILE_ERROR),
522522
errmsg("multibyte flag character is not allowed")));
523523

524-
Conf->flagval[(unsignedint)*s]= (unsignedchar)val;
524+
Conf->flagval[*(unsignedchar*)s]= (unsignedchar)val;
525525
Conf->usecompound= true;
526526
}
527527

@@ -654,7 +654,7 @@ NIImportOOAffixes(IspellDict *Conf, const char *filename)
654654
ptr=repl+ (ptr-prepl)+1;
655655
while (*ptr)
656656
{
657-
aflg |=Conf->flagval[(unsignedint)*ptr];
657+
aflg |=Conf->flagval[*(unsignedchar*)ptr];
658658
ptr++;
659659
}
660660
}
@@ -735,7 +735,7 @@ NIImportAffixes(IspellDict *Conf, const char *filename)
735735

736736
if (*s&&pg_mblen(s)==1)
737737
{
738-
Conf->flagval[(unsignedint)*s]=FF_COMPOUNDFLAG;
738+
Conf->flagval[*(unsignedchar*)s]=FF_COMPOUNDFLAG;
739739
Conf->usecompound= true;
740740
}
741741
oldformat= true;
@@ -791,7 +791,7 @@ NIImportAffixes(IspellDict *Conf, const char *filename)
791791
(errcode(ERRCODE_CONFIG_FILE_ERROR),
792792
errmsg("multibyte flag character is not allowed")));
793793

794-
flag= (unsignedchar)*s;
794+
flag=*(unsignedchar*)s;
795795
gotonextline;
796796
}
797797
if (STRNCMP(recoded,"COMPOUNDFLAG")==0||STRNCMP(recoded,"COMPOUNDMIN")==0||
@@ -851,7 +851,7 @@ makeCompoundFlags(IspellDict *Conf, int affix)
851851

852852
while (str&&*str)
853853
{
854-
flag |=Conf->flagval[(unsignedint)*str];
854+
flag |=Conf->flagval[*(unsignedchar*)str];
855855
str++;
856856
}
857857

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp