mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-11-29 08:49:40 +03:00
vty_set_custom_table_range: avoid overflow in test
This commit is contained in:
parent
24b9c8c0f5
commit
b988b6894e
@ -286,11 +286,13 @@ int vty_init_custom_table(int size)
|
||||
int vty_set_custom_table_range(uint32_t start, uint32_t size, uint8_t width)
|
||||
{
|
||||
if ((custom_table == NULL) ||
|
||||
((start + size - 1) >= custom_table_size) ||
|
||||
(size >= custom_table_size) ||
|
||||
(start >= custom_table_size) ||
|
||||
((start + 1) >= (custom_table_size - size)) ||
|
||||
custom_table_ready) {
|
||||
return 1;
|
||||
} else {
|
||||
memset(custom_table + start, (uint8_t) width, size);
|
||||
memset(custom_table + start, width, size);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user