git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: e116bcf) | patch
Add a stack overflow check to copyObject().
Tue, 7 Dec 2010 03:55:51 +0000 (22:55 -0500)
Tue, 7 Dec 2010 03:55:51 +0000 (22:55 -0500)
commit a65b29794a394afdea78a3ee367ca8fd373788e3
Add a stack overflow check to copyObject().

There are some code paths, such as SPI_execute(), where we invoke
copyObject() on raw parse trees before doing parse analysis on them. Since
the bison grammar is capable of building heavily nested parsetrees while
itself using only minimal stack depth, this means that copyObject() can be
the front-line function that hits stack overflow before anything else does.
Accordingly, it had better have a check_stack_depth() call. I did a bit of
performance testing and found that this slows down copyObject() by only a
few percent, so the hit ought to be negligible in the context of complete
processing of a query.

Per off-list report from Toshihide Katayama. Back-patch to all supported
branches.
src/backend/nodes/copyfuncs.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /