diff --git a/.werks/17196 b/.werks/17196 new file mode 100644 index 00000000000..f152d359e97 --- /dev/null +++ b/.werks/17196 @@ -0,0 +1,11 @@ +Title: Crash in during HW/SW inventory on Windows +Class: fix +Compatible: compat +Component: checks +Date: 1728416670 +Edition: cre +Level: 1 +Version: 2.2.0p36 + +This fixes a crash in case software package names contained a pipe character (|). +Affected users need to redeploy the Checkmk agent. diff --git a/agents/windows/plugins/mk_inventory.vbs b/agents/windows/plugins/mk_inventory.vbs index 4a9edfb6074..cfb58bf9733 100644 --- a/agents/windows/plugins/mk_inventory.vbs +++ b/agents/windows/plugins/mk_inventory.vbs @@ -249,7 +249,7 @@ Sub SoftwareFromInstaller(fields) idx = idx + 1 Next - outPut(Join(values, "|")) + outPut(Join(values, Chr(0))) else 'Products function Err.clear() @@ -262,7 +262,7 @@ Sub SoftwareFromInstaller(fields) idx = idx + 1 Next - outPut(Join(values, "|")) + outPut(Join(values, Chr(0))) end if Next End Sub @@ -321,7 +321,7 @@ Call startSection("win_ip_r",124,timeUntil) Call getRouteTable() ' Installed Software -Call startSection("win_wmi_software",124,timeUntil) +Call startSection("win_wmi_software",0,timeUntil) swVars = Array( "ProductName", "Publisher", "VersionString", "InstallDate", "Language") Call SoftwareFromInstaller(swVars) @@ -335,7 +335,7 @@ Do While Not objExecObject.StdOut.AtEndOfStream Loop ' Search Registry -Call startSection("win_reg_uninstall",124,timeUntil) +Call startSection("win_reg_uninstall",0,timeUntil) Set rego = GetObject("WinMgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv") regVars = Array("DisplayName", "Publisher", "InstallLocation", "PSChildName", "DisplayVersion", "EstimatedSize", "InstallDate", "Language") @@ -359,13 +359,13 @@ For Each path in regPaths End If ' Only allow vartypes which can be represented as a string If VarType(value) <= 8 and VarType(value) > 1 Then - strOut = strOut & "|" & CStr(value) + strOut = strOut & Chr(0) & CStr(value) ' Only print a line when more than only PSChildName is present If var <> "PSChildName" Then boleanContent = True End If Else - strOut = strOut & "|" + strOut = strOut & Chr(0) End If Next If boleanContent Then