Fix typo in http-push.c
authorJan Andres <jandres@gmx.net>
Tue, 29 Nov 2005 00:51:54 +0000 (01:51 +0100)
committerJunio C Hamano <junkio@cox.net>
Tue, 29 Nov 2005 05:56:30 +0000 (21:56 -0800)
Typo resulted in accessing past the beginning of a string causing segfaults.

[jc: signoffs?]

http-push.c

index 76c7886..ad78982 100644 (file)
@@ -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);
                        }
                }