cve-2009-2286.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. *** file.c.org 2009-06-29 09:17:41.000000000 +0200
  2. --- file.c 2009-06-29 09:18:27.000000000 +0200
  3. ***************
  4. *** 82,107 ****
  5. char *table = table_nop; /* optionally invert bits in nibble */
  6. register inc = 0; /* optionally swap nimmles */
  7. int bits;
  8. t = s = fbuf;
  9. /* Does this look like an X bitmap ? */
  10. if (sscanf(s, "#define %*s %d", &bits) == 1) {
  11. if (bits == 48) {
  12. ! char type1[128];
  13. ! char type2[128];
  14. while (*s && *s++ != '\n');
  15. if (sscanf(s, "#define %*s %d", &bits) == 1) if (bits == 48) {
  16. while (*s && *s++ != '\n');
  17. ! if (sscanf(s, "static %s %s", type1,type2)==2 &&
  18. (!strcmp(type1, "char") ||
  19. !strcmp(type2, "char"))) {
  20. while (*s && *s++ != '\n');
  21. inc = 1;
  22. table = table_inv;
  23. }
  24. ! else fprintf(stderr,
  25. ! "warning: xbitmap line 3 not static [unsigned] short ...\n");
  26. }
  27. else fprintf(stderr, "warning: xbitmaps must be 48x48\n");
  28. }
  29. --- 82,110 ----
  30. char *table = table_nop; /* optionally invert bits in nibble */
  31. register inc = 0; /* optionally swap nimmles */
  32. int bits;
  33. + int len;
  34. t = s = fbuf;
  35. /* Does this look like an X bitmap ? */
  36. if (sscanf(s, "#define %*s %d", &bits) == 1) {
  37. if (bits == 48) {
  38. ! char type1[256];
  39. ! char type2[256];
  40. while (*s && *s++ != '\n');
  41. if (sscanf(s, "#define %*s %d", &bits) == 1) if (bits == 48) {
  42. while (*s && *s++ != '\n');
  43. ! for (len=0; s[len] && s[len]!='\n'; len++);
  44. ! if (len<255) {
  45. ! if (sscanf(s, "static %s %s", type1,type2)==2 &&
  46. (!strcmp(type1, "char") ||
  47. !strcmp(type2, "char"))) {
  48. while (*s && *s++ != '\n');
  49. inc = 1;
  50. table = table_inv;
  51. }
  52. ! else fprintf(stderr, "warning: xbitmap line 3 not static [unsigned] short ...\n");
  53. ! } else fprintf(stderr, "warning: xbitmap line 3 too long\n");
  54. }
  55. else fprintf(stderr, "warning: xbitmaps must be 48x48\n");
  56. }