diff options
author | Damjan Marion <damarion@cisco.com> | 2023-11-06 17:37:04 +0000 |
---|---|---|
committer | Damjan Marion <damarion@cisco.com> | 2023-11-06 17:40:07 +0000 |
commit | e73c731ad8890d1b64c55e3e9dfb9fc8529624f9 (patch) | |
tree | d446d4e893a75b9f44ce4c0e3279456e54561167 /src/vppinfra/vec_bootstrap.h | |
parent | 4504df795b0ffc4863b12b0d97786423d8b63562 (diff) |
vppinfra: fix ASAN issue in vec_foreach_pointer and pool_foreach_pointer
Change-Id: If9381ae7283488b352a3c22f85732cd56ac6bfd9
Type: fix
Fixes: 9937359, 91ff0e9
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/vec_bootstrap.h')
-rw-r--r-- | src/vppinfra/vec_bootstrap.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vppinfra/vec_bootstrap.h b/src/vppinfra/vec_bootstrap.h index 5ea7a8003f5..5d386b1eaad 100644 --- a/src/vppinfra/vec_bootstrap.h +++ b/src/vppinfra/vec_bootstrap.h @@ -240,8 +240,8 @@ _vec_set_len (void *v, uword len, uword elt_sz) #define vec_foreach_pointer(e, v) \ if (v) \ - for (typeof (**v) **__ep = (v), *(e) = *__ep; __ep - (v) < vec_len (v); \ - __ep++, (e) = *__ep) + for (typeof (**v) **__ep = (v), **__end = vec_end (v), *(e) = *__ep; \ + __ep < __end; __ep++, (e) = __ep < __end ? *__ep : (e)) #endif /* included_clib_vec_bootstrap_h */ |