On Sun, Aug 04, 2019 at 10:25:01AM +0200, John Crispin wrote:
> > +static int
> > +mbim_home_provider_response(void *buffer, size_t len)
> > +{
> > +   struct mbim_basic_connect_home_provider_r *state = (struct 
> > mbim_basic_connect_home_provider_r *) buffer;
> > +   char *provider_id, *provider_name;
> > +
> > +   if (len < sizeof(struct mbim_basic_connect_home_provider_r)) {
> > +           fprintf(stderr, "message not long enough\n");
> > +           return -1;
> > +   }
> > +   struct mbimprovider *provider = &state->provider;
> 
> please move this to the start of the function

Thanks for the remark. I moved the declaration to the start of the
function but kept the initialization below the length check (with the
idea to better not touch the struct if something is known to be wrong
with it).

Best regards,
Ingo

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to