Skip to content

Commit

Permalink
Fix typo in http-push.c
Browse files Browse the repository at this point in the history
Typo resulted in accessing past the beginning of a string causing segfaults.

[jc: signoffs?]
  • Loading branch information
Jan Andres authored and Junio C Hamano committed Nov 29, 2005
1 parent f2e6f1c commit 3e2f62b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion http-push.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ static void handle_new_lock_ctx(struct xml_ctx *ctx, int tag_closed)
strtol(ctx->cdata + 7, NULL, 10);
} else if (!strcmp(ctx->name, DAV_ACTIVELOCK_TOKEN)) {
if (!strncmp(ctx->cdata, "opaquelocktoken:", 16)) {
lock->token = xmalloc(strlen(ctx->cdata - 15));
lock->token = xmalloc(strlen(ctx->cdata) - 15);
strcpy(lock->token, ctx->cdata + 16);
}
}
Expand Down

0 comments on commit 3e2f62b

Please sign in to comment.