summaryrefslogtreecommitdiffstats
path: root/lib/libcbor/src/cbor/internal/stack.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2020-08-03 02:34:31 +0000
committerdjm <djm@openbsd.org>2020-08-03 02:34:31 +0000
commitd3425be1b595f829612797540c858ad1f176643f (patch)
treeeee6a023293527d42c6ef171bd3b61a48cda344b /lib/libcbor/src/cbor/internal/stack.c
parentSplit some code that gives clang10 heartburn (diff)
downloadwireguard-openbsd-d3425be1b595f829612797540c858ad1f176643f.tar.xz
wireguard-openbsd-d3425be1b595f829612797540c858ad1f176643f.zip
sync to upstream libcbor v0.7.0; some minor fixes, but a note major
crank due to ABI change.
Diffstat (limited to 'lib/libcbor/src/cbor/internal/stack.c')
-rw-r--r--lib/libcbor/src/cbor/internal/stack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libcbor/src/cbor/internal/stack.c b/lib/libcbor/src/cbor/internal/stack.c
index fc433ef31f0..79c9e5e5297 100644
--- a/lib/libcbor/src/cbor/internal/stack.c
+++ b/lib/libcbor/src/cbor/internal/stack.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2019 Pavel Kalvoda <me@pavelkalvoda.com>
+ * Copyright (c) 2014-2020 Pavel Kalvoda <me@pavelkalvoda.com>
*
* libcbor is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
@@ -21,6 +21,7 @@ void _cbor_stack_pop(struct _cbor_stack *stack) {
struct _cbor_stack_record *_cbor_stack_push(struct _cbor_stack *stack,
cbor_item_t *item,
size_t subitems) {
+ if (stack->size == CBOR_MAX_STACK_SIZE) return NULL;
struct _cbor_stack_record *new_top =
_CBOR_MALLOC(sizeof(struct _cbor_stack_record));
if (new_top == NULL) return NULL;