From: doug Date: Wed, 29 Apr 2015 02:02:46 +0000 (+0000) Subject: Call CBB_add_space() rather than reimplementing it. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=18f8c184323d9ffd01f371dcabb10a1b8a3c59e3;p=openbsd Call CBB_add_space() rather than reimplementing it. ok jsing@ --- diff --git a/lib/libssl/bs_cbb.c b/lib/libssl/bs_cbb.c index 07315e86bbc..b766e850d33 100644 --- a/lib/libssl/bs_cbb.c +++ b/lib/libssl/bs_cbb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bs_cbb.c,v 1.7 2015/04/29 01:49:28 doug Exp $ */ +/* $OpenBSD: bs_cbb.c,v 1.8 2015/04/29 02:02:46 doug Exp $ */ /* * Copyright (c) 2014, Google Inc. * @@ -324,7 +324,7 @@ CBB_add_bytes(CBB *cbb, const uint8_t *data, size_t len) { uint8_t *dest; - if (!CBB_flush(cbb) || !cbb_buffer_add(cbb->base, &dest, len)) + if (!CBB_add_space(cbb, &dest, len)) return 0; memcpy(dest, data, len); diff --git a/lib/libssl/src/ssl/bs_cbb.c b/lib/libssl/src/ssl/bs_cbb.c index 07315e86bbc..b766e850d33 100644 --- a/lib/libssl/src/ssl/bs_cbb.c +++ b/lib/libssl/src/ssl/bs_cbb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bs_cbb.c,v 1.7 2015/04/29 01:49:28 doug Exp $ */ +/* $OpenBSD: bs_cbb.c,v 1.8 2015/04/29 02:02:46 doug Exp $ */ /* * Copyright (c) 2014, Google Inc. * @@ -324,7 +324,7 @@ CBB_add_bytes(CBB *cbb, const uint8_t *data, size_t len) { uint8_t *dest; - if (!CBB_flush(cbb) || !cbb_buffer_add(cbb->base, &dest, len)) + if (!CBB_add_space(cbb, &dest, len)) return 0; memcpy(dest, data, len);