Skip to content

Commit 99f35fd

Browse files
robertmhaaskelvich
authored andcommitted
Improve check for overly-long extensible node name.
The old code is bad for two reasons. First, it has an off-by-one error. Second, it won't help if you aren't running with assertions enabled. Per discussion, we want a check here in that case too. Author: KaiGai Kohei, adjusted by me. Reviewed-by: Petr Jelinek Discussion: 56E0D547.1030101@2ndquadrant.com
1 parent 6260216 commit 99f35fd

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy