summaryrefslogtreecommitdiffstats
path: root/src/dom
diff options
context:
space:
mode:
authorKees Cook <kees@outflux.net>2007-03-20 17:16:36 +0000
committerkeescook <keescook@users.sourceforge.net>2007-03-20 17:16:36 +0000
commit4687a1c9ffe0d1d3f6ea01f360faa542a5b6491c (patch)
tree734a4d35a4e7b90593ae86a6c9006e58ce23d7d1 /src/dom
parentpatch by cilix42 for bug 1671665 (diff)
downloadinkscape-4687a1c9ffe0d1d3f6ea01f360faa542a5b6491c.tar.gz
inkscape-4687a1c9ffe0d1d3f6ea01f360faa542a5b6491c.zip
format string protection/clean up (CVE-2007-1463, CVE-2007-1464)
(bzr r2720)
Diffstat (limited to 'src/dom')
-rw-r--r--src/dom/cssparser.h3
-rw-r--r--src/dom/jsdombind.h5
-rw-r--r--src/dom/jsengine.h5
-rw-r--r--src/dom/lsimpl.h4
-rw-r--r--src/dom/minidom.h4
-rw-r--r--src/dom/svg/svgparser.h3
-rw-r--r--src/dom/uri.h5
-rw-r--r--src/dom/util/ziptool.h9
-rw-r--r--src/dom/xmlreader.cpp2
-rw-r--r--src/dom/xmlreader.h3
-rw-r--r--src/dom/xmlwriter.h3
-rw-r--r--src/dom/xpathparser.h5
12 files changed, 32 insertions, 19 deletions
diff --git a/src/dom/cssparser.h b/src/dom/cssparser.h
index 0b399f7d5..816936dc3 100644
--- a/src/dom/cssparser.h
+++ b/src/dom/cssparser.h
@@ -29,6 +29,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <glib.h>
#include "dom.h"
@@ -81,7 +82,7 @@ protected:
/**
*
*/
- void error(char *fmt, ...);
+ void error(char *fmt, ...) G_GNUC_PRINTF(2,3);
/**
* Get the character at the given location in the buffer.
diff --git a/src/dom/jsdombind.h b/src/dom/jsdombind.h
index f995a1f53..33a71816a 100644
--- a/src/dom/jsdombind.h
+++ b/src/dom/jsdombind.h
@@ -29,6 +29,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <glib.h>
#include "jsengine.h"
@@ -126,12 +127,12 @@ private:
/**
* Ouput a printf-formatted error message
*/
- void error(char *fmt, ...);
+ void error(char *fmt, ...) G_GNUC_PRINTF(2,3);
/**
* Ouput a printf-formatted error message
*/
- void trace(char *fmt, ...);
+ void trace(char *fmt, ...) G_GNUC_PRINTF(2,3);
JSRuntime *rt;
diff --git a/src/dom/jsengine.h b/src/dom/jsengine.h
index abcbb23e9..f47a7a4c7 100644
--- a/src/dom/jsengine.h
+++ b/src/dom/jsengine.h
@@ -29,6 +29,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <glib.h>
#include "dom.h"
#include "js/jsapi.h"
@@ -133,12 +134,12 @@ private:
/**
* Ouput a printf-formatted error message
*/
- void error(char *fmt, ...);
+ void error(char *fmt, ...) G_GNUC_PRINTF(2,3);
/**
* Ouput a printf-formatted error message
*/
- void trace(char *fmt, ...);
+ void trace(char *fmt, ...) G_GNUC_PRINTF(2,3);
JSRuntime *rt;
diff --git a/src/dom/lsimpl.h b/src/dom/lsimpl.h
index 0f0088684..d73998e13 100644
--- a/src/dom/lsimpl.h
+++ b/src/dom/lsimpl.h
@@ -29,6 +29,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <glib.h>
+
#include "domimpl.h"
#include "events.h"
#include "traversal.h"
@@ -236,7 +238,7 @@ private:
void spaces();
- void po(char *fmt, ...);
+ void po(char *fmt, ...) G_GNUC_PRINTF(2,3);
void pos(const DOMString &str);
diff --git a/src/dom/minidom.h b/src/dom/minidom.h
index b1ad82f07..41af805fb 100644
--- a/src/dom/minidom.h
+++ b/src/dom/minidom.h
@@ -1,3 +1,5 @@
+#include <glib.h>
+
#include <string>
#include <vector>
@@ -237,7 +239,7 @@ private:
void getLineAndColumn(int pos, int *lineNr, int *colNr);
- void error(char *fmt, ...);
+ void error(char *fmt, ...) G_GNUC_PRINTF(2,3);
int peek(int pos);
diff --git a/src/dom/svg/svgparser.h b/src/dom/svg/svgparser.h
index 9305a553a..307b44e01 100644
--- a/src/dom/svg/svgparser.h
+++ b/src/dom/svg/svgparser.h
@@ -30,6 +30,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <glib.h>
#include "svgimpl.h"
@@ -122,7 +123,7 @@ protected:
/**
*
*/
- void error(char *format, ...);
+ void error(char *format, ...) G_GNUC_PRINTF(2,3);
diff --git a/src/dom/uri.h b/src/dom/uri.h
index 8bc7df6da..8b95686b8 100644
--- a/src/dom/uri.h
+++ b/src/dom/uri.h
@@ -30,6 +30,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <glib.h>
#include "dom.h"
@@ -197,9 +198,9 @@ private:
DOMString fragment;
- void error(const char *fmt, ...);
+ void error(const char *fmt, ...) G_GNUC_PRINTF(2,3);
- void trace(const char *fmt, ...);
+ void trace(const char *fmt, ...) G_GNUC_PRINTF(2,3);
int peek(int p);
diff --git a/src/dom/util/ziptool.h b/src/dom/util/ziptool.h
index 895f0ccb2..120fe568a 100644
--- a/src/dom/util/ziptool.h
+++ b/src/dom/util/ziptool.h
@@ -32,6 +32,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <glib.h>
#include <vector>
#include <string>
@@ -203,8 +204,8 @@ private:
std::string fileName;
//debug messages
- void error(char *fmt, ...);
- void trace(char *fmt, ...);
+ void error(char *fmt, ...) G_GNUC_PRINTF(2,3);
+ void trace(char *fmt, ...) G_GNUC_PRINTF(2,3);
unsigned long crc;
@@ -469,8 +470,8 @@ public:
private:
//debug messages
- void error(char *fmt, ...);
- void trace(char *fmt, ...);
+ void error(char *fmt, ...) G_GNUC_PRINTF(2,3);
+ void trace(char *fmt, ...) G_GNUC_PRINTF(2,3);
//# Private writing methods
diff --git a/src/dom/xmlreader.cpp b/src/dom/xmlreader.cpp
index 5e8184e4d..6e6db723d 100644
--- a/src/dom/xmlreader.cpp
+++ b/src/dom/xmlreader.cpp
@@ -788,7 +788,7 @@ int XmlReader::parseNode(int p0, NodePtr node, int depth)
closeTagQualifiedName);
if (openTagQualifiedName != closeTagQualifiedName)
{
- error("Mismatched closing tag. Expected </%S>. Got '%S'.",
+ error("Mismatched closing tag. Expected </%s>. Got '%s'.",
openTagQualifiedName.c_str(), closeTagQualifiedName.c_str());
return p0;
}
diff --git a/src/dom/xmlreader.h b/src/dom/xmlreader.h
index 1060555c7..f616fd1e1 100644
--- a/src/dom/xmlreader.h
+++ b/src/dom/xmlreader.h
@@ -30,6 +30,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <glib.h>
#include "dom.h"
@@ -80,7 +81,7 @@ public:
protected:
- void error(char *format, ...);
+ void error(char *format, ...) G_GNUC_PRINTF(2,3);
int get(int ch);
int peek(int ch);
diff --git a/src/dom/xmlwriter.h b/src/dom/xmlwriter.h
index bd8501019..925dacd51 100644
--- a/src/dom/xmlwriter.h
+++ b/src/dom/xmlwriter.h
@@ -33,6 +33,7 @@
#include "dom.h"
#include <stdio.h>
+#include <glib.h>
namespace org
@@ -64,7 +65,7 @@ protected:
void spaces();
- void po(char *str, ...);
+ void po(char *str, ...) G_GNUC_PRINTF(2,3);
void pos(const DOMString &str);
diff --git a/src/dom/xpathparser.h b/src/dom/xpathparser.h
index ce5656228..7a5b7cb55 100644
--- a/src/dom/xpathparser.h
+++ b/src/dom/xpathparser.h
@@ -33,6 +33,7 @@
#include <stdio.h>
#include <stdarg.h>
+#include <glib.h>
#include <string>
#include <vector>
@@ -415,7 +416,7 @@ private:
/**
*
*/
- void trace(const char *fmt, ...);
+ void trace(const char *fmt, ...) G_GNUC_PRINTF(2,3);
/**
*
@@ -425,7 +426,7 @@ private:
/**
*
*/
- void error(const char *fmt, ...);
+ void error(const char *fmt, ...) G_GNUC_PRINTF(2,3);
//#################################
//# LEXICAL SCANNING