&& (memcmp(s, "/__overlay__", len - 1) == 0)) {
/* /<fragment-name>/__overlay__ */
rel_path = "";
- rel_path_len = 0;
+ rel_path_len = 1; /* Include NUL character */
} else {
/* Symbol refers to something that won't end
* up in the target tree */
}
ret = fdt_setprop_placeholder(fdt, root_sym, name,
- len + (len > 1) + rel_path_len + 1, &p);
+ len + (len > 1) + rel_path_len, &p);
if (ret < 0)
return ret;
buf[len] = '/';
memcpy(buf + len + 1, rel_path, rel_path_len);
- buf[len + 1 + rel_path_len] = '\0';
}
return 0;