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

Commit5ae3bf1

Browse files
committed
to_char(): prevent accesses beyond the allocated buffer
Previously very long field masks for floats could access memorybeyond the existing buffer allocated to hold the result.Reported by Andres Freund and Peter Geoghegan.Backpatch to allsupported versions.Security:CVE-2015-0241
1 parent611037d commit5ae3bf1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/backend/utils/adt/formatting.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4409,7 +4409,9 @@ NUM_numpart_to_char(NUMProc *Np, int id)
44094409
Np->num_in= TRUE;
44104410
}
44114411
}
4412-
++Np->number_p;
4412+
/* do no exceed string length */
4413+
if (*Np->number_p)
4414+
++Np->number_p;
44134415
}
44144416

44154417
end=Np->num_count+ (Np->out_pre_spaces ?1 :0)+ (IS_DECIMAL(Np->Num) ?1 :0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp