Merge branch 'bc/push-cert-receive-fix'

"git receive-pack" could have been forced to die by attempting
allocate an unreasonably large amount of memory with a crafted push
certificate; this has been fixed.

* bc/push-cert-receive-fix:
  builtin/receive-pack: fix incorrect pointer arithmetic
This commit is contained in:
Junio C Hamano 2017-03-30 14:07:18 -07:00
Родитель cd49f9bfb8 f2214dede9
Коммит e711824c5e
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -1524,7 +1524,7 @@ static void queue_commands_from_cert(struct command **tail,
while (boc < eoc) { while (boc < eoc) {
const char *eol = memchr(boc, '\n', eoc - boc); const char *eol = memchr(boc, '\n', eoc - boc);
tail = queue_command(tail, boc, eol ? eol - boc : eoc - eol); tail = queue_command(tail, boc, eol ? eol - boc : eoc - boc);
boc = eol ? eol + 1 : eoc; boc = eol ? eol + 1 : eoc;
} }
} }