iemejia opened a new pull request, #3889:
URL: https://github.com/apache/avro/pull/3889
## What is the purpose of the change
Record field names and enum symbols were not validated against the Avro name
grammar when compiling a schema, unlike named-type simple names which are
already checked by `Name::check()`. As a result an out-of-spec string could
be
emitted verbatim as a C++ identifier by the code generator (`avrogencpp`).
This change validates record field names and enum symbols during schema
compilation, rejecting anything that is not a non-empty sequence of
`[A-Za-z0-9_]` (the same rule already applied to named-type simple names).
Part of AVRO-4312.
## Verifying this change
This change added tests and can be verified as follows:
- Added negative parser cases to `test/SchemaTests.cc` (`basicSchemaErrors`)
covering spaces and identifier-injection attempts in both field names and
enum symbols.
- Verified locally with CMake/g++/Boost.Test: `SchemaTests` (185 cases,
including the new negatives), `CompilerTests`, `unittest`, and
`CommonsSchemasTests` (which parses the shared interop schemas) all pass.
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]