Copilot commented on code in PR #13633:
URL: https://github.com/apache/trafficserver/pull/13633#discussion_r3932261112
##########
src/proxy/http/remap/RemapConfig.cc:
##########
@@ -1164,6 +1164,11 @@ remap_parse_config_bti(const char *path,
BUILD_TABLE_INFO *bti, ConfigContext ct
tok_count = whiteTok.Initialize(cur_line, (SHARE_TOKS | ALLOW_SPACES));
for (int j = 0; j < tok_count; j++) {
+ if (bti->argc >= BUILD_TABLE_MAX_ARGS || bti->paramc >=
BUILD_TABLE_MAX_ARGS) {
+ snprintf(errStrBuf, sizeof(errStrBuf), "too many arguments on line %d
in file %s", cln + 1, path);
Review Comment:
The new error string includes file and line number, but `MAP_ERROR` already
logs the path and line (`... at %s line %d: %s`). This will produce redundant
messages like "... at foo line 12: too many arguments on line 12 in file foo";
consider keeping the location only in the outer log and using this string for
the actual error detail (ideally including the max).
--
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]