
< 			upper = kmemdup(&entry[max + 1],
---
> 			if (max + 1 < mas.last) {
> 				upper = kmemdup(&entry[max + 1],
> 			} else {
> 				upper = NULL;
> 			}
