Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
ipsec: fix length check when adding footer+icv
[vpp.git]
/
src
/
vnet
/
ipsec
/
esp_encrypt.c
diff --git
a/src/vnet/ipsec/esp_encrypt.c
b/src/vnet/ipsec/esp_encrypt.c
index
30c2bf9
..
68aeb60
100644
(file)
--- a/
src/vnet/ipsec/esp_encrypt.c
+++ b/
src/vnet/ipsec/esp_encrypt.c
@@
-129,7
+129,8
@@
esp_add_footer_and_icv (vlib_main_t *vm, vlib_buffer_t **last, u8 esp_align,
last[0]->current_length + pad_bytes);
u16 tail_sz = sizeof (esp_footer_t) + pad_bytes + icv_sz;
last[0]->current_length + pad_bytes);
u16 tail_sz = sizeof (esp_footer_t) + pad_bytes + icv_sz;
- if (last[0]->current_length + tail_sz > buffer_data_size)
+ if (last[0]->current_data + last[0]->current_length + tail_sz >
+ buffer_data_size)
{
u32 tmp_bi = 0;
if (vlib_buffer_alloc (vm, &tmp_bi, 1) != 1)
{
u32 tmp_bi = 0;
if (vlib_buffer_alloc (vm, &tmp_bi, 1) != 1)