@@ -286,11 +286,13 @@ int vty_init_custom_table(int size)
286286int vty_set_custom_table_range(uint32_t start, uint32_t size, uint8_t width)
287287{
288288 if ((custom_table == NULL) ||
289− ((start + size - 1) >= custom_table_size) ||
289+ (size >= custom_table_size) ||
290+ (start >= custom_table_size) ||
291+ ((start + 1) >= (custom_table_size - size)) ||
290292 custom_table_ready) {
291293 return 1;
292294 } else {
293− memset(custom_table + start, (uint8_t) width, size);
295+ memset(custom_table + start, width, size);
294296 return 0;
295297 }
296298}