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

<[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <001801c7d28b$84d754a0$8e85fde0$@com>
Forget this :-)

All my problem came from the usage of a buffer inialized by usb-serial.c that is too small for my module.. So I was writing or reading outside the memory allocation dedicated to the urb structure....


Alain

-----Message d'origine-----
De : Oliver Neukum [mailto:[email protected]] 
Envoyé : dimanche 29 juillet 2007 21:42
À : [email protected]
Cc : [email protected]
Objet : Re: [linux-usb-devel] [PATCH] USB Pegasus driver - avoid a potential NULL pointer dereference.

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.