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

Commitf19669f

Browse files
committed
unaccent: Fix allocation size for target characters on initial load
This led to an overestimation of the size allocated for both the quotedand non-quoted cases, while using an inconsistent style. Thinkos in59f47fb.Per report from Coverity, with extra input from Tom Lane.
1 parent1f9e3a9 commitf19669f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎contrib/unaccent/unaccent.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ initTrie(const char *filename)
238238
if (trgquoted&&state>0)
239239
{
240240
/* Ignore first and end quotes */
241-
trgstore=palloc0(sizeof(char*)*trglen-2);
241+
trgstore=(char*)palloc(sizeof(char)* (trglen-2));
242242
trgstorelen=0;
243243
for (inti=1;i<trglen-1;i++)
244244
{
@@ -251,7 +251,7 @@ initTrie(const char *filename)
251251
}
252252
else
253253
{
254-
trgstore=palloc0(sizeof(char*)*trglen);
254+
trgstore=(char*)palloc(sizeof(char)*trglen);
255255
trgstorelen=trglen;
256256
memcpy(trgstore,trg,trgstorelen);
257257
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp