From 5d469f4a1cf430b0bad033cf8de79ef080f0dde0 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 2 Dec 2021 15:24:16 +0000 Subject: [PATCH] 10.31: Annocheck: Allow space in golang symbols --- annobin-global.h | 2 +- annocheck/hardened.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/annobin-global.h b/annobin-global.h index 98d8abe..be0c055 100644 --- a/annobin-global.h +++ b/annobin-global.h @@ -19,7 +19,7 @@ extern "C" { /* The version of the package. NB/ This number is expected to be in the form "NNnn" where "NN" is major version number and "nn" is the minor version number. */ -#define ANNOBIN_VERSION 1030 +#define ANNOBIN_VERSION 1031 /* The version of the annotation specification supported. */ #define SPEC_VERSION 3 diff --git a/annocheck/hardened.c b/annocheck/hardened.c index a900987..1a190c4 100644 --- a/annocheck/hardened.c +++ b/annocheck/hardened.c @@ -3557,6 +3557,10 @@ contains_suspicious_characters (const unsigned char * name) if (isgraph (c)) continue; + /* Golang allows spaces in some symbols. */ + if (c == ' ' && (per_file.lang == LANG_GO || (per_file.seen_tools & TOOL_GO))) + continue; + /* Control characters are always suspect. So are spaces and DEL */ if (iscntrl (c) || c == ' ' || c == 0x7f) return true; -- 2.43.5