From f4a00f2b0f8eb5668f015c24d7c32b800e2c2bcb Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 23 Nov 2015 14:31:27 -0500 Subject: [PATCH] field names may not begin with a digit Enforce C identifer syntax [A-Za-z_][A-Za-z0-9_]* --- src/factory/FieldCreateFactory.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/factory/FieldCreateFactory.cpp b/src/factory/FieldCreateFactory.cpp index 696b3a1..7551315 100644 --- a/src/factory/FieldCreateFactory.cpp +++ b/src/factory/FieldCreateFactory.cpp @@ -955,8 +955,14 @@ bool xisalnum(char c) void validateFieldName(const std::string& n) { + // enforce [A-Za-z_][A-Za-z0-9_]* if(n.size()==0) throw std::invalid_argument("zero length field names not allowed"); + if(n[0]>='0' && n[0]<='9') { + std::ostringstream msg; + msg<<"Field name \""<