Commit 2f660a3
committed
linuxkm/linuxkm_wc_port.h: in my_memmove(), early-return when n == 0 to avoid size_t underflow
The backward-copy branches compute (n - 1) as size_t, which wraps to SIZE_MAX for n == 0 and, with src below dest, drives the loop backward through kernel memory until it oopses; matches glibc / musl / kernel memmove().
Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>1 parent 7ca42d1 commit 2f660a3
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| 453 | + | |
| 454 | + | |
453 | 455 | | |
454 | 456 | | |
455 | 457 | | |
| |||
0 commit comments