summaryrefslogtreecommitdiff
path: root/src/commonmark.c
diff options
context:
space:
mode:
authorPhil Turnbull <philipturnbull@github.com>2017-07-06 10:59:09 -0400
committerYuki Izumi <ashe@kivikakk.ee>2017-07-11 13:12:57 +1000
commitc07bb95a832d041b8a61b48037a4e7a987314aca (patch)
tree7dc83e70b2faba108ac8fa07497f3e93b214b1f9 /src/commonmark.c
parent4b83812e6780e4a58669272a7426f1491711ca8c (diff)
Use unsigned integer when shifting
A UBSAN warning can be triggered when handling a long sequence of backticks: src/commonmark.c:98:20: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' which can be triggered by: ``` | a | b | | --- | --** `c```````````````````````````````- | | c | `|d` \| e | ```
Diffstat (limited to 'src/commonmark.c')
-rw-r--r--src/commonmark.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/commonmark.c b/src/commonmark.c
index a9ba566..95a1ae5 100644
--- a/src/commonmark.c
+++ b/src/commonmark.c
@@ -93,7 +93,7 @@ static int shortest_unused_backtick_sequence(const char *code) {
current++;
} else {
if (current > 0 && current < 32) {
- used |= (1 << current);
+ used |= (1U << current);
}
current = 0;
}