]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: allow sshbuf_put_stringb(buf, NULL); ok markus@
authordjm@openbsd.org <djm@openbsd.org>
Fri, 13 Dec 2019 19:09:37 +0000 (19:09 +0000)
committerDamien Miller <djm@mindrot.org>
Fri, 13 Dec 2019 20:17:44 +0000 (07:17 +1100)
OpenBSD-Commit-ID: 91482c1ada9adb283165d48dafbb88ae91c657bd

sshbuf-getput-basic.c

index d401a72653a654ec34e97ca9f0d8f76b559d5fdb..da834d0080c6e7d0afef766cc7ab5eee5e381efb 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sshbuf-getput-basic.c,v 1.9 2019/09/06 04:53:27 djm Exp $     */
+/*     $OpenBSD: sshbuf-getput-basic.c,v 1.10 2019/12/13 19:09:37 djm Exp $    */
 /*
  * Copyright (c) 2011 Damien Miller
  *
@@ -535,6 +535,9 @@ sshbuf_put_cstring(struct sshbuf *buf, const char *v)
 int
 sshbuf_put_stringb(struct sshbuf *buf, const struct sshbuf *v)
 {
+       if (v == NULL)
+               return sshbuf_put_string(buf, NULL, 0);
+
        return sshbuf_put_string(buf, sshbuf_ptr(v), sshbuf_len(v));
 }