Revert "udev: prepare memory for extra NUL termination for NULSTR"

This reverts commit cd3c8a117c which was
papering over the bug instead of a proper fix made by the previous
commit.
This commit is contained in:
Dmitry V. Levin
2023-03-19 11:32:09 +00:00
parent c43ff248f9
commit 8c499a61c4
+1 -3
View File
@@ -1148,9 +1148,7 @@ static int rule_add_line(UdevRuleFile *rule_file, const char *line_str, unsigned
if (isempty(line_str))
return 0;
/* We use memdup_suffix0() here, since we want to add a second NUL byte to the end, since possibly
* some parsers might turn this into a "nulstr", which requires an extra NUL at the end. */
line = memdup_suffix0(line_str, strlen(line_str) + 1);
line = strdup(line_str);
if (!line)
return log_oom();