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

Commit3adf9ce

Browse files
committed
Improve check for overly-long extensible node name.
The old code is bad for two reasons. First, it has an off-by-oneerror. Second, it won't help if you aren't running with assertionsenabled. Per discussion, we want a check here in that case too.Author: KaiGai Kohei, adjusted by me.Reviewed-by: Petr JelinekDiscussion: 56E0D547.1030101@2ndquadrant.com
1 parent2da7549 commit3adf9ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/nodes/extensible.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ RegisterExtensibleNodeMethods(const ExtensibleNodeMethods *methods)
5151
100,&ctl,HASH_ELEM);
5252
}
5353

54-
Assert(strlen(methods->extnodename) <=EXTNODENAME_MAX_LEN);
54+
if (strlen(methods->extnodename) >=EXTNODENAME_MAX_LEN)
55+
elog(ERROR,"extensible node name is too long");
5556

5657
entry= (ExtensibleNodeEntry*)hash_search(extensible_node_methods,
5758
methods->extnodename,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp