Page MenuHomeFreeBSD

D41771.id.diff
No OneTemporary

D41771.id.diff

diff --git a/usr.bin/bsdiff/bspatch/bspatch.c b/usr.bin/bsdiff/bspatch/bspatch.c
--- a/usr.bin/bsdiff/bspatch/bspatch.c
+++ b/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

Mime Type
text/plain
Expires
Tue, Mar 31, 4:17 AM (6 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30618915
Default Alt Text
D41771.id.diff (713 B)

Event Timeline