[components] [fdt] add parameter check
This commit is contained in:
parent
1c7e7738a7
commit
d2308d41d7
@ -96,7 +96,9 @@ static int _fdt_splice(void *fdt, void *splicepoint, int oldlen, int newlen)
|
||||
{
|
||||
char *p = splicepoint;
|
||||
char *end = (char *)fdt + _fdt_data_size(fdt);
|
||||
|
||||
|
||||
if (oldlen <= 0)
|
||||
return -FDT_ERR_BADOFFSET;
|
||||
if (((p + oldlen) < p) || ((p + oldlen) > end))
|
||||
return -FDT_ERR_BADOFFSET;
|
||||
if ((p < (char *)fdt) || ((end - oldlen + newlen) < (char *)fdt))
|
||||
|
Loading…
x
Reference in New Issue
Block a user