Thread (3 messages) flat view 3 messages, 1 author, 2016-06-15
DORMANTno replies

[PATCH 2/2] bisect: avoid signed integer overflow

From: John Keeping <hidden>
Date: 2016-06-15 22:56:37
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: John Keeping <redacted>
---
 bisect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bisect.c b/bisect.c
index bd1b7b5..0d33c6f 100644
--- a/bisect.c
+++ b/bisect.c
@@ -526,7 +526,7 @@ struct commit_list *filter_skipped(struct commit_list *list,
  * for this application.
  */
 static int get_prn(int count) {
-	count = count * 1103515245 + 12345;
+	count = ((unsigned) count) * 1103515245 + 12345;
 	return ((unsigned)(count/65536) % PRN_MODULO);
 }
 
-- 
1.8.2.540.gf023cfe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help