]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: make sshbuf_putb(b, NULL) a no-op
authordjm@openbsd.org <djm@openbsd.org>
Fri, 5 Jun 2020 03:25:35 +0000 (03:25 +0000)
committerDamien Miller <djm@mindrot.org>
Fri, 5 Jun 2020 03:28:29 +0000 (13:28 +1000)
OpenBSD-Commit-ID: 976fdc99b500e347023d430df372f31c1dd128f7

sshbuf-getput-basic.c

index da834d0080c6e7d0afef766cc7ab5eee5e381efb..9803fb5ed904c388c2a81f3c56d194c9fa632107 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sshbuf-getput-basic.c,v 1.10 2019/12/13 19:09:37 djm Exp $    */
+/*     $OpenBSD: sshbuf-getput-basic.c,v 1.11 2020/06/05 03:25:35 djm Exp $    */
 /*
  * Copyright (c) 2011 Damien Miller
  *
@@ -338,6 +338,8 @@ sshbuf_put(struct sshbuf *buf, const void *v, size_t len)
 int
 sshbuf_putb(struct sshbuf *buf, const struct sshbuf *v)
 {
+       if (v == NULL)
+               return 0;
        return sshbuf_put(buf, sshbuf_ptr(v), sshbuf_len(v));
 }