Issue with "trimmed string" inspector

(imported topic written by BenKus)

Hi everybody,

We just found out a bug with the “trimmed string” inspector that could cause the agent to crash. The bug is basically that if you try to use the “as trimmed string” inspector (or other variants like “as right trimmed string”) on an empty string, then the agent might crash.

We don’t currently have any Fixlet or properties that we publish that use this inspector, but we know that some people have used it in custom Fixlets and custom properties.

There is a simple way to mitigate this with some additional relevance. For instance, if you had a relevance such as:

q: string values of selects “Manufacturer from Win32_ComputerSystem” of wmi as trimmed string
A: Dell Inc.

You can change it to first check for an empty string like this:

q: (if (it != “”) then it as trimmed string else it) of string values of selects “Manufacturer from Win32_ComputerSystem” of wmi
A: Dell Inc.

We will fix this issue in the next version of BigFix, but we wanted to give a warning for anyone that might be using it now.

Ben

(imported comment written by SystemAdmin)

Ben,

Do we need to do an outside evaluation like in your example, or can we get away with using something like…

(it != “” and it as left trimmed string starts with “#”) of …

-Paul

(imported comment written by BenKus)

Hey Paul,

That will work (as long as you check the non-empty string before you use the trimmed string inspector).

Ben