Skip to content

Commit 15d5b29

Browse files
PrivacyIsARightDuncaen
authored andcommitted
lib: fix off-by-one buffer allocation
1 parent 5f65469 commit 15d5b29

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/package_alternatives.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ relpath(char *from, char *to)
104104

105105
for (up = -1, from--; from && *from; from = strchr(from + 1, '/'), up++);
106106

107-
rel = calloc(3 * up + strlen(p), 1);
107+
rel = calloc(3 * up + strlen(p) + 1, 1);
108108
if (!rel)
109109
return NULL;
110110

0 commit comments

Comments
 (0)