Skip to content

Commit d11c4a1

Browse files
authored
Merge pull request libgit2#4571 from jacquesg/overflow
Integer overflow
2 parents 515683c + e666495 commit d11c4a1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ ELSE ()
221221
ENABLE_WARNINGS(strict-aliasing)
222222
ENABLE_WARNINGS(strict-prototypes)
223223
ENABLE_WARNINGS(declaration-after-statement)
224+
ENABLE_WARNINGS(shift-count-overflow)
224225
DISABLE_WARNINGS(unused-const-variable)
225226
DISABLE_WARNINGS(unused-function)
226227

include/git2/diff.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,18 +200,18 @@ typedef enum {
200200
/** Use the "patience diff" algorithm */
201201
GIT_DIFF_PATIENCE = (1u << 28),
202202
/** Take extra time to find minimal diff */
203-
GIT_DIFF_MINIMAL = (1 << 29),
203+
GIT_DIFF_MINIMAL = (1u << 29),
204204

205205
/** Include the necessary deflate / delta information so that `git-apply`
206206
* can apply given diff information to binary files.
207207
*/
208-
GIT_DIFF_SHOW_BINARY = (1 << 30),
208+
GIT_DIFF_SHOW_BINARY = (1u << 30),
209209

210210
/** Use a heuristic that takes indentation and whitespace into account
211211
* which generally can produce better diffs when dealing with ambiguous
212212
* diff hunks.
213213
*/
214-
GIT_DIFF_INDENT_HEURISTIC = (1 << 31),
214+
GIT_DIFF_INDENT_HEURISTIC = (1u << 31),
215215
} git_diff_option_t;
216216

217217
/**

0 commit comments

Comments
 (0)