Ismaël Mejía created AVRO-4347:
----------------------------------
Summary: [c++] Name validation permits a leading digit, yielding
invalid generated identifiers
Key: AVRO-4347
URL: https://issues.apache.org/jira/browse/AVRO-4347
Project: Apache Avro
Issue Type: Bug
Components: c++
Reporter: Ismaël Mejía
Fix For: 1.13.0
{{Name::check()}} in the C++ SDK ({{lang/c++/impl/Node.cc}}) validates the
namespace and simple-name characters but permits a *leading digit* in the simple
name -- the first-character check does not enforce {{[A-Za-z_]}}. A type named
e.g. {{9foo}} or {{123}} passes validation and is emitted verbatim as a C++
identifier ({{struct 9foo { ... \} }}), which does not compile.
Tighten {{Name::check()}} so the simple name matches the Avro grammar
{{[A-Za-z_][A-Za-z0-9_]*}}, ensuring generated identifiers are always
well-formed,
and add a test. (Related to AVRO-4312, which covers field names and enum
symbols.)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)