format_string_vuln.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. --- a/xmlschemas.c
  2. +++ b/xmlschemas.c
  3. @@ -2295,7 +2295,7 @@ xmlSchemaInternalErr(xmlSchemaAbstractCt
  4. const char *funcName,
  5. const char *message)
  6. {
  7. - xmlSchemaInternalErr2(actxt, funcName, message, NULL, NULL);
  8. + xmlSchemaInternalErr2(actxt, funcName, "%s", message, NULL);
  9. }
  10. #if 0
  11. @@ -2332,7 +2332,7 @@ xmlSchemaCustomErr4(xmlSchemaAbstractCtx
  12. msg = xmlStrcat(msg, (const xmlChar *) message);
  13. msg = xmlStrcat(msg, BAD_CAST ".\n");
  14. xmlSchemaErr4(actxt, error, node,
  15. - (const char *) msg, str1, str2, str3, str4);
  16. + message, str1, str2, str3, str4);
  17. FREE_AND_NULL(msg)
  18. }
  19. @@ -2369,7 +2369,7 @@ xmlSchemaCustomWarning(xmlSchemaAbstract
  20. /* URGENT TODO: Set the error code to something sane. */
  21. xmlSchemaErr4Line(actxt, XML_ERR_WARNING, error, node, 0,
  22. - (const char *) msg, str1, str2, str3, NULL);
  23. + message, str1, str2, str3, NULL);
  24. FREE_AND_NULL(msg)
  25. }
  26. @@ -2749,7 +2749,7 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtP
  27. }
  28. #define VERROR(err, type, msg) \
  29. - xmlSchemaCustomErr(ACTXT_CAST vctxt, err, NULL, type, msg, NULL, NULL);
  30. + xmlSchemaCustomErr(ACTXT_CAST vctxt, err, NULL, type, "%s", msg, NULL);
  31. #define VERROR_INT(func, msg) xmlSchemaInternalErr(ACTXT_CAST vctxt, func, msg);