From 08f807e64a2bf34a716a27cdfde022664979b46a Mon Sep 17 00:00:00 2001 From: G S Niteesh Babu Date: Thu, 18 Mar 2021 08:20:56 +0530 Subject: rtems-fdt/rtems-fdt.c: Fix bug in loop termination The while loop, loops infinitely in case of raw FDT data. The loop condition (size) is not modified during iterations. Fixes #4350 --- cpukit/libmisc/rtems-fdt/rtems-fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpukit/libmisc/rtems-fdt/rtems-fdt.c b/cpukit/libmisc/rtems-fdt/rtems-fdt.c index 39e70bffec..b96ccbc1b0 100644 --- a/cpukit/libmisc/rtems-fdt/rtems-fdt.c +++ b/cpukit/libmisc/rtems-fdt/rtems-fdt.c @@ -582,7 +582,7 @@ rtems_fdt_load (const char* filename, rtems_fdt_handle* handle) close (bf); return -RTEMS_FDT_ERR_READ_FAIL; } - r -= size; + size -= r; buf += r; } } -- cgit v1.2.3