Skip to content

Commit a29ba71

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 fc5535f commit a29ba71

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
@@ -790,7 +790,11 @@ config_read(const char *filename)
790790
break;
791791
case oMarkOffsetBits:
792792
sscanf(p1, "%u", &config.markoffsetbits);
793-
config.markoffsetbits = config.markoffsetbits > 31 ? 0 : config.markoffsetbits;
793+
if (config.markoffsetbits > 31) {
794+
config.markoffsetbits = 0;
795+
debug(LOG_WARNING, "MarkOffsetBits is invalid. It should be in the range of 0 to 31. "
796+
"Fallback to no offset!");
797+
}
794798
break;
795799
case oBadOption:
796800
/* FALL THROUGH */

0 commit comments

Comments
 (0)