Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154078038
D41771.id127055.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
735 B
Referenced Files
None
Subscribers
None
D41771.id127055.diff
View Options
Index: usr.bin/bsdiff/bspatch/bspatch.c
===================================================================
--- usr.bin/bsdiff/bspatch/bspatch.c
+++ usr.bin/bsdiff/bspatch/bspatch.c
@@ -36,6 +36,7 @@
#include <fcntl.h>
#include <libgen.h>
#include <limits.h>
+#include <stdckdint.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -64,15 +65,8 @@
{
off_t result;
-#if __GNUC__ >= 5 || \
- (defined(__has_builtin) && __has_builtin(__builtin_add_overflow))
- if (__builtin_add_overflow(a, b, &result))
+ if (ckd_add(&result, a, b))
errx(1, "Corrupt patch");
-#else
- if ((b > 0 && a > OFF_MAX - b) || (b < 0 && a < OFF_MIN - b))
- errx(1, "Corrupt patch");
- result = a + b;
-#endif
return result;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 27, 12:20 AM (19 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32190107
Default Alt Text
D41771.id127055.diff (735 B)
Attached To
Mode
D41771: bspatch: use C23 overflow checking math now that it is available
Attached
Detach File
Event Timeline
Log In to Comment