From: Jan Andres Date: Tue, 29 Nov 2005 00:51:54 +0000 (+0100) Subject: Fix typo in http-push.c X-Git-Tag: v0.99.9l^2~36 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3e2f62bebfe8e9aeea63849c37c65f25ea001e65;p=git.git Fix typo in http-push.c Typo resulted in accessing past the beginning of a string causing segfaults. [jc: signoffs?] --- diff --git a/http-push.c b/http-push.c index 76c788673..ad789829c 100644 --- a/http-push.c +++ b/http-push.c @@ -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); } }