upstream: make sshbuf_putb(b, NULL) a no-op

OpenBSD-Commit-ID: 976fdc99b500e347023d430df372f31c1dd128f7
This commit is contained in:
2020-06-05 13:28:29 +10:00
committed by Damien Miller
parent 69796297c8
commit ea547eb032
+3 -1
View 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));
}