Re: [PATCH] USB Pegasus driver - avoid a potential NULL pointer dereference.

Oliver Neukum <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
Am Sonntag 29 Juli 2007 schrieb [email protected]:
> I have the same problem in my development..
> 
> Somewhere  in my code:
> 
>         unsigned char *data = urb->transfer_buffer ;
> ....
>         if ( data == NULL )
>                         dbg("%s - data is NULL !!!",__FUNCTION__ );
> 
>         if ( urb->actual_length == 1  && data != NULL )
>                 len = (int) data[0];
> 
> 
> If I don’t do this check in a usb callback function, I have kernel panic
> deference to null pointer !
> But the fun stuff in this story is that I never see the debug " data is NULL
> !!! " so This never happen if I do this check....

urb->transfer_buffer is set by the caller. Usbcore should never change
it. What do you set it to?

	Regards
		Oliver

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.