Commit 6bfd233
committed
dahdi-base: fix potential underflow of unsigned type
Compile fails on newer kernels due to better fortification of memcpy
calls.
In function 'strncat',
inlined from 'dahdi_ioctl_get_version' at dahdi-linux-3.4.0/drivers/dahdi/dahdi-base.c:5405:3:
./include/linux/fortify-string.h:114:33: error: '__builtin_memcpy' accessing 4294967295 bytes at offsets [80, 238] and 0 overlaps 6442450943 bytes at offset -2147483648 [-Werror=restrict]
114 | #define __underlying_memcpy __builtin_memcpy
| ^
./include/linux/fortify-string.h:457:9: note: in expansion of macro '__underlying_memcpy'
457 | __underlying_memcpy(p + p_len, q, copy_len);
| ^~~~~~~~~~~~~~~~~~~
Fix this by avoiding a potential underflow of unsigned type size_t.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>1 parent 648016d commit 6bfd233
1 file changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5380 | 5380 | | |
5381 | 5381 | | |
5382 | 5382 | | |
5383 | | - | |
| 5383 | + | |
5384 | 5384 | | |
5385 | 5385 | | |
5386 | 5386 | | |
| |||
5404 | 5404 | | |
5405 | 5405 | | |
5406 | 5406 | | |
5407 | | - | |
5408 | | - | |
| 5407 | + | |
| 5408 | + | |
5409 | 5409 | | |
| 5410 | + | |
5410 | 5411 | | |
5411 | 5412 | | |
5412 | 5413 | | |
| |||
0 commit comments