ref: 980f5e20c84751abcc73f018541202eb9e8c67a9
parent: 0196d80a85932d6630b0daa58ec77f54d8481b35
author: Ori Bernstein <ori@eigenstate.org>
date: Fri May 9 14:48:26 EDT 2025
git: fix parsing of author lines we had two problems: the lines could get a bit tight when someone could have very long names, and the author name was being copied into the buffer incorrectly.
--- a/sys/src/cmd/git/pack.c
+++ b/sys/src/cmd/git/pack.c
@@ -835,7 +835,8 @@
if(n >= sizeof(buf))
sysfatal("overlong author line");
memset(m, 0, sizeof(m));
- snprint(buf, n + 1, *str);
+ memcpy(buf, *str, n);
+ buf[n] = 0;
*str = p;
*nstr -= n;
@@ -862,7 +863,7 @@
static void
parsecommit(Object *o)
{
- char *p, *t, buf[128];
+ char *p, *t, buf[512];
int np;
p = o->data;
--
⑨