cdrkit-1.1.9-buffer_overflow.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. diff -ru origin-1.1.9/wodim/scsi_cdr.c master-1.1.9/wodim/scsi_cdr.c
  2. --- origin-1.1.9/wodim/scsi_cdr.c 2008-02-25 12:14:07.000000000 +0100
  3. +++ master-1.1.9/wodim/scsi_cdr.c 2009-07-16 12:01:29.000000000 +0200
  4. @@ -2181,26 +2181,30 @@
  5. if (inq->add_len == 0) {
  6. if (usalp->dev == DEV_UNKNOWN && got_inquiry) {
  7. usalp->dev = DEV_ACB5500;
  8. - strcpy(inq->vendor_info,
  9. - "ADAPTEC ACB-5500 FAKE");
  10. + strncpy(inq->vendor_info, "ADAPTEC ", 8);
  11. + strncpy(inq->prod_ident,"ACB-5500 ", 16);
  12. + strncpy(inq->prod_revision, "FAKE", 4);
  13. } else switch (usalp->dev) {
  14. -
  15. case DEV_ACB40X0:
  16. - strcpy(inq->vendor_info,
  17. - "ADAPTEC ACB-40X0 FAKE");
  18. + strncpy(inq->vendor_info, "ADAPTEC ", 8);
  19. + strncpy(inq->prod_ident, "ACB-40X0 ",16);
  20. + strncpy(inq->prod_revision, "FAKE", 4);
  21. break;
  22. case DEV_ACB4000:
  23. - strcpy(inq->vendor_info,
  24. - "ADAPTEC ACB-4000 FAKE");
  25. + strncpy(inq->vendor_info, "ADAPTEC ",8);
  26. + strncpy(inq->prod_ident, "ACB-4000 ",16);
  27. + strncpy(inq->prod_revision, "FAKE",4);
  28. break;
  29. case DEV_ACB4010:
  30. - strcpy(inq->vendor_info,
  31. - "ADAPTEC ACB-4010 FAKE");
  32. + strncpy(inq->vendor_info, "ADAPTEC ",8);
  33. + strncpy(inq->prod_ident, "ACB-4010 ",16);
  34. + strncpy(inq->prod_revision, "FAKE",4);
  35. break;
  36. case DEV_ACB4070:
  37. - strcpy(inq->vendor_info,
  38. - "ADAPTEC ACB-4070 FAKE");
  39. + strncpy(inq->vendor_info,"ADAPTEC ",8);
  40. + strncpy(inq->prod_ident, "ACB-4070 ", 16);
  41. + strncpy(inq->prod_revision, "FAKE",4 );
  42. break;
  43. }
  44. } else if (inq->add_len < 31) {
  45. @@ -2230,14 +2234,16 @@
  46. case INQ_SEQD:
  47. if (usalp->dev == DEV_SC4000) {
  48. - strcpy(inq->vendor_info,
  49. - "SYSGEN SC4000 FAKE");
  50. + strncpy(inq->vendor_info,"SYSGEN ",8);
  51. + strncpy(inq->prod_ident, "SC4000 ",16);
  52. + strncpy(inq->prod_revision, "FAKE",4);
  53. } else if (inq->add_len == 0 &&
  54. inq->removable &&
  55. inq->ansi_version == 1) {
  56. usalp->dev = DEV_MT02;
  57. - strcpy(inq->vendor_info,
  58. - "EMULEX MT02 FAKE");
  59. + strncpy(inq->vendor_info,"EMULEX ",8);
  60. + strncpy(inq->prod_ident, "MT02 ",16);
  61. + strncpy(inq->prod_revision, "FAKE",4);
  62. }
  63. break;