From 2f040a96711aaa576ce983b962b4e92abfa238b4 Mon Sep 17 00:00:00 2001 From: Tal Kelrich Date: Tue, 31 Aug 2021 15:55:54 +0000 Subject: fast-export: fix anonymized tag using original length Commit 7f4075949686 (fast-export: tighten anonymize_mem() interface to handle only strings, 2020-06-23) changed the interface used in anonymizing strings, but failed to update the size of annotated tag messages to match the new anonymized string. As a result, exporting tags having messages longer than 13 characters would create output that couldn't be parsed by fast-import, as the data length indicated was larger than the data output. Reset the message size when anonymizing, and add a tag with a "long" message to the test. Signed-off-by: Tal Kelrich Signed-off-by: Junio C Hamano --- builtin/fast-export.c | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin') diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 85a76e0ef8..8b7fc2dcd5 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -821,6 +821,7 @@ static void handle_tag(const char *name, struct tag *tag) static struct hashmap tags; message = anonymize_str(&tags, anonymize_tag, message, message_size, NULL); + message_size = strlen(message); } } -- cgit v1.3