Skip to content

Commit 3842eee

Browse files
committed
src/schema_compile_node.c: coverity fix - overflowed constant
1 parent ec20337 commit 3842eee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/schema_compile_node.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,9 @@ lys_compile_pattern_chblocks_xmlschema2perl(const struct ly_ctx *ctx, const char
12291229
++idx;
12301230
}
12311231
if ((perl_regex[idx2] == ']') && (!idx2 || (perl_regex[idx2 - 1] != '\\'))) {
1232-
--idx;
1232+
if (idx > 0) {
1233+
--idx;
1234+
}
12331235
}
12341236
}
12351237
if (idx) {

0 commit comments

Comments
 (0)