From e87776f5cfb28d2f016dc41567169aa602cc592b Mon Sep 17 00:00:00 2001 From: z00500798 Date: Fri, 23 Aug 2024 11:37:24 +0800 Subject: [PATCH] Description:sale problem fix Feature or Bugfix:Bugfix Binary Source: No Signed-off-by: zl_zl --- services/utils/init_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/utils/init_utils.c b/services/utils/init_utils.c index daa924b6d..b45ed0587 100644 --- a/services/utils/init_utils.c +++ b/services/utils/init_utils.c @@ -191,7 +191,7 @@ char *ReadFileData(const char *fileName) INIT_ERROR_CHECK(buffer != NULL, close(fd); return NULL, "Failed to allocate memory for %s", fileName); ssize_t readLen = read(fd, buffer, MAX_SMALL_BUFFER - 1); - INIT_ERROR_CHECK((readLen > 0) && (readLen < (MAX_SMALL_BUFFER - 1)), close(fd); + INIT_ERROR_CHECK((readLen > 0) && (readLen <= (MAX_SMALL_BUFFER - 1)), close(fd); free(buffer); return NULL, "Failed to read data for %s", fileName); buffer[readLen] = '\0';