diff options
author | djm@openbsd.org <djm@openbsd.org> | 2019-12-13 19:09:37 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2019-12-14 07:17:44 +1100 |
commit | 612b1dd1ec91ffb1e01f58cca0c6eb1d47bf4423 (patch) | |
tree | f1c395349027a350c1ee4fe5801c8c122ac08d65 /sshbuf-getput-basic.c | |
parent | b52ec0ba3983859514aa7b57d6100fa9759fe696 (diff) |
upstream: allow sshbuf_put_stringb(buf, NULL); ok markus@
OpenBSD-Commit-ID: 91482c1ada9adb283165d48dafbb88ae91c657bd
Diffstat (limited to 'sshbuf-getput-basic.c')
-rw-r--r-- | sshbuf-getput-basic.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sshbuf-getput-basic.c b/sshbuf-getput-basic.c index d401a7265..da834d008 100644 --- a/sshbuf-getput-basic.c +++ b/sshbuf-getput-basic.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshbuf-getput-basic.c,v 1.9 2019/09/06 04:53:27 djm Exp $ */ | 1 | /* $OpenBSD: sshbuf-getput-basic.c,v 1.10 2019/12/13 19:09:37 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2011 Damien Miller | 3 | * Copyright (c) 2011 Damien Miller |
4 | * | 4 | * |
@@ -535,6 +535,9 @@ sshbuf_put_cstring(struct sshbuf *buf, const char *v) | |||
535 | int | 535 | int |
536 | sshbuf_put_stringb(struct sshbuf *buf, const struct sshbuf *v) | 536 | sshbuf_put_stringb(struct sshbuf *buf, const struct sshbuf *v) |
537 | { | 537 | { |
538 | if (v == NULL) | ||
539 | return sshbuf_put_string(buf, NULL, 0); | ||
540 | |||
538 | return sshbuf_put_string(buf, sshbuf_ptr(v), sshbuf_len(v)); | 541 | return sshbuf_put_string(buf, sshbuf_ptr(v), sshbuf_len(v)); |
539 | } | 542 | } |
540 | 543 | ||