Skip to content

Commit dc8c8bc

Browse files
committed
Add warning log for a large value of MarkOffsetBits configuration
* The MarkOffsetBits should be in the range of 0 to 31, the large value should be logged with warning message. Thanks to Michael Haas (mhaas) for comment.
1 parent 91d6af9 commit dc8c8bc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/conf.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,11 @@ config_read(const char *filename)
780780
break;
781781
case oMarkOffsetBits:
782782
sscanf(p1, "%u", &config.markoffsetbits);
783-
config.markoffsetbits = config.markoffsetbits > 31 ? 0 : config.markoffsetbits;
783+
if (config.markoffsetbits > 31) {
784+
config.markoffsetbits = 0;
785+
debug(LOG_WARNING, "MarkOffsetBits is invalid. It should be in the range of 0 to 31. "
786+
"Fallback to no offset!");
787+
}
784788
break;
785789
case oBadOption:
786790
/* FALL THROUGH */

0 commit comments

Comments
 (0)