I possess a machine with ')' in its BIOS version string, which will
cause the current parser to mistake it as the closing ')' of the
smbios-fields() expression.
Let's make sure we always fo for the last, not the first ')', hence.
_cleanup_free_ char *dtc_arg = NULL;
char *end;
- end = strchr(arg, ')');
+ end = strrchr(arg, ')');
if (!end || *(end + 1) != '\0') {
log_debug("Malformed ConditionFirmware=%s", c->parameter);
return false;
_cleanup_free_ char *smbios_arg = NULL;
char *end;
- end = strchr(arg, ')');
+ end = strrchr(arg, ')');
if (!end || *(end + 1) != '\0')
return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Malformed ConditionFirmware=%s: %m", c->parameter);