diff options
Diffstat (limited to 'src/trunnel/ed25519_cert.c')
-rw-r--r-- | src/trunnel/ed25519_cert.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/trunnel/ed25519_cert.c b/src/trunnel/ed25519_cert.c index ee010dbff9..f495743667 100644 --- a/src/trunnel/ed25519_cert.c +++ b/src/trunnel/ed25519_cert.c @@ -1,4 +1,4 @@ -/* ed25519_cert.c -- generated by Trunnel v1.4.3. +/* ed25519_cert.c -- generated by Trunnel v1.4.4. * https://gitweb.torproject.org/trunnel.git * You probably shouldn't edit this file. */ @@ -289,7 +289,8 @@ ed25519_cert_extension_encode(uint8_t *output, const size_t avail, const ed25519 trunnel_assert(written <= avail); if (avail - written < elt_len) goto truncated; - memcpy(ptr, obj->un_unparsed.elts_, elt_len); + if (elt_len) + memcpy(ptr, obj->un_unparsed.elts_, elt_len); written += elt_len; ptr += elt_len; } break; @@ -374,7 +375,8 @@ ed25519_cert_extension_parse_into(ed25519_cert_extension_t *obj, const uint8_t * /* Parse u8 un_unparsed[] */ TRUNNEL_DYNARRAY_EXPAND(uint8_t, &obj->un_unparsed, remaining, {}); obj->un_unparsed.n_ = remaining; - memcpy(obj->un_unparsed.elts_, ptr, remaining); + if (remaining) + memcpy(obj->un_unparsed.elts_, ptr, remaining); ptr += remaining; remaining -= remaining; break; } |