Skip to content

Commit 839cc37

Browse files
PrivacyIsARightDuncaen
authored andcommitted
bin/xbps-pkgdb: fix off-by-one buffer allocation
1 parent 638c984 commit 839cc37

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bin/xbps-pkgdb/check_pkg_alternatives.c

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

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

88-
rel = calloc(3 * up + strlen(p), sizeof(char));
88+
rel = calloc(3 * up + strlen(p) + 1, sizeof(char));
8989

9090
while (up--)
9191
strcat(rel, "../");

0 commit comments

Comments
 (0)