=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/signify/zsig.c,v retrieving revision 1.17 retrieving revision 1.18 diff -c -r1.17 -r1.18 *** src/usr.bin/signify/zsig.c 2019/12/09 09:41:54 1.17 --- src/usr.bin/signify/zsig.c 2019/12/22 06:37:25 1.18 *************** *** 1,4 **** ! /* $OpenBSD: zsig.c,v 1.17 2019/12/09 09:41:54 espie Exp $ */ /* * Copyright (c) 2016 Marc Espie * --- 1,4 ---- ! /* $OpenBSD: zsig.c,v 1.18 2019/12/22 06:37:25 espie Exp $ */ /* * Copyright (c) 2016 Marc Espie * *************** *** 181,187 **** { struct gzheader h; size_t bufsize, len; ! char *p, *meta; uint8_t *bufend; int fdin, fdout; --- 181,187 ---- { struct gzheader h; size_t bufsize, len; ! char *p; uint8_t *bufend; int fdin, fdout; *************** *** 199,207 **** fake[8] = h.xflg; len = h.endcomment-h.comment; - meta = xmalloc(len+1); - memcpy(meta, h.comment, len); - meta[len] = 0; p = verifyzdata(h.comment, len, sigfile, pubkeyfile, keytype); --- 199,204 ---- *************** *** 219,230 **** if (*p != '\n') errx(1, "invalid signature"); - *(p++) = 0; fdout = xopen(msgfile, O_CREAT|O_TRUNC|O_NOFOLLOW|O_WRONLY, 0666); writeall(fdout, fake, sizeof fake, msgfile); ! writeall(fdout, meta, len+1, msgfile); ! free(meta); copy_blocks(fdout, fdin, p, h.endcomment, bufsize, bufend); free(h.buffer); close(fdout); --- 216,226 ---- if (*p != '\n') errx(1, "invalid signature"); fdout = xopen(msgfile, O_CREAT|O_TRUNC|O_NOFOLLOW|O_WRONLY, 0666); writeall(fdout, fake, sizeof fake, msgfile); ! writeall(fdout, h.comment, len+1, msgfile); ! *(p++) = 0; copy_blocks(fdout, fdin, p, h.endcomment, bufsize, bufend); free(h.buffer); close(fdout);