[PATCH] fix for possible crash in cdda_identify_scsi() (interface/scan_devices.c)

Gernot Hillier <[email protected]>
Newsgroups gmane.comp.audio.cd-paranoia.general
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

I always got a SIGSEGV in a KDE cd burning tool (k3b) after turning off my 
SCSI-scanner. 

With the help of SuSE, I now found out that the crash was caused by 
cdparanoia-III-alpha9.8.

Please see the attached patch - NULL value of the result of scsi_inquiry() 
wasn't checked correctly which lead to a SIGSEGV in strncmp() naturally...

If this is not the right place to send patches to, please tell me what it 
is... ;-)

- -- 
Ciao,

Gernot
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9ielYk997/GGeSeIRAuf4AJoCLSD1aXG3inrlQ/5WsZfmkqG3UQCgi0pM
qdIWPJUgy7ic0O+PHD5yj0o=
=B1nA
-----END PGP SIGNATURE-----
cdparanoia-III-alpha9.8-solve-crash.patch (text/x-diff, 536 B)
diff -uNr cdparanoia-III-alpha9.8/interface/scan_devices.c cdparanoia-III-alpha9.8-new/interface/scan_devices.c
--- cdparanoia-III-alpha9.8/interface/scan_devices.c	Mon Mar 26 07:44:01 2001
+++ cdparanoia-III-alpha9.8-new/interface/scan_devices.c	Thu Sep 19 16:47:56 2002
@@ -617,7 +617,7 @@
 
   /* It would seem some TOSHIBA CDROMs gets things wrong */
  
-  if (!strncmp (p + 8, "TOSHIBA", 7) &&
+  if (p && !strncmp (p + 8, "TOSHIBA", 7) &&
       !strncmp (p + 16, "CD-ROM", 6) &&
       p[0] == TYPE_DISK) {
     p[0] = TYPE_ROM;
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.