From cd47c2446f1a9dee96610f298989848f8986a8be Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 00:55:52 +0200 Subject: Merging upstream version 7.0.16-dfsg. Signed-off-by: Daniel Baumann --- src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c') diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c index 538a0bc4..499ad791 100644 --- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c +++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c @@ -79,6 +79,7 @@ #include #include #include +#include /********************************************************************************************************************************* @@ -661,6 +662,10 @@ static int __init vgdrvLinuxModInit(void) PRTLOGGER pRelLogger; int rc; + /* Check if modue loading was disabled. */ + if (!vbox_mod_should_load()) + return -EINVAL; + /* * Initialize IPRT first. */ @@ -1361,8 +1366,7 @@ static int vgdrvLinuxParamLogGrpSet(const char *pszValue, CONST_4_15 struct kern RTLogGroupSettings(pLogger, pszValue); } else if (pParam->name[0] != 'd') - strlcpy(&g_szLogGrp[0], pszValue, sizeof(g_szLogGrp)); - + RTStrCopy(&g_szLogGrp[0], sizeof(g_szLogGrp), pszValue); return 0; } @@ -1387,7 +1391,7 @@ static int vgdrvLinuxParamLogFlagsSet(const char *pszValue, CONST_4_15 struct ke RTLogFlags(pLogger, pszValue); } else if (pParam->name[0] != 'd') - strlcpy(&g_szLogFlags[0], pszValue, sizeof(g_szLogFlags)); + RTStrCopy(&g_szLogFlags[0], sizeof(g_szLogFlags), pszValue); return 0; } @@ -1412,7 +1416,7 @@ static int vgdrvLinuxParamLogDstSet(const char *pszValue, CONST_4_15 struct kern RTLogDestinations(pLogger, pszValue); } else if (pParam->name[0] != 'd') - strlcpy(&g_szLogDst[0], pszValue, sizeof(g_szLogDst)); + RTStrCopy(&g_szLogDst[0], sizeof(g_szLogDst), pszValue); return 0; } -- cgit v1.2.3