lsat-0.9.7.1-segfault-fix.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --- lsat-0.9.7.1/lsatmain.c.orig 2008-12-29 11:09:04.000000000 -0500
  2. +++ lsat-0.9.7.1/lsatmain.c 2008-12-29 13:31:00.000000000 -0500
  3. @@ -232,7 +232,7 @@ int versions(char release[], char kernel
  4. } /* end while (fgets...) */
  5. close(fileval);
  6. /* clean up even though we will rm it */
  7. - close(infile);
  8. + close((int)infile);
  9. if ( (system("rm -f /tmp/lsat1.lsat")) < 0)
  10. {
  11. @@ -308,9 +308,9 @@ int main(int argc, char *argv[])
  12. */
  13. char release[50]; /* array for release level */
  14. char kernel[50]; /* what kernel user is running */
  15. - static char *man_distro; /* if the user specifies a distribution */
  16. + static char man_distro[10]; /* if the user specifies a distribution */
  17. const char * header =NULL; /* to print out the header */
  18. - static char *out_file = "lsat.out"; /* output filename var */
  19. + static char out_file[255] = "lsat.out"; /* output filename var */
  20. char xlist[100]; /* modules to exclude */
  21. int xarray[33] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  22. int somethinginxlist = 0;
  23. @@ -350,10 +350,10 @@ int main(int argc, char *argv[])
  24. diff = 1;
  25. break;
  26. case 'm':
  27. - strcpy(man_distro, argv[i]+3);
  28. + strncpy(man_distro, argv[i]+3,sizeof(man_distro));
  29. break;
  30. case 'o':
  31. - strcpy(out_file, argv[i]+3);
  32. + strncpy(out_file, argv[i]+3,sizeof(out_file));
  33. break;
  34. case 'r':
  35. rpmmodule = 1;
  36. @@ -366,7 +366,7 @@ int main(int argc, char *argv[])
  37. break;
  38. case 'w':
  39. html = 1;
  40. - out_file="lsat.html";
  41. + strcpy(out_file,"lsat.html");
  42. break;
  43. case 'x': strcpy(xlist,argv[i]+3);
  44. somethinginxlist = 1;