Re: [PATCH] ANDROID: binder: re-order some conditions

2018-03-29 Thread Martijn Coenen
On Thu, Mar 29, 2018 at 11:14 AM, Dan Carpenter wrote: > It doesn't make any difference to runtime but I've switched these two > checks to make my static checker happy. > > The problem is that "buffer->data_size" is user controlled and if it's > less than "sizeo(*hdr)" then that means "offset" can

[PATCH] ANDROID: binder: re-order some conditions

2018-03-29 Thread Dan Carpenter
It doesn't make any difference to runtime but I've switched these two checks to make my static checker happy. The problem is that "buffer->data_size" is user controlled and if it's less than "sizeo(*hdr)" then that means "offset" can be more than "buffer->data_size". It's just cleaner to check it