summaryrefslogtreecommitdiffstats
path: root/src/sp-cursor.cpp
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2012-02-05 08:46:46 +0000
committerKris <Kris.De.Gussem@hotmail.com>2012-02-05 08:46:46 +0000
commit1a7064b86be0898eead7323b94084ebfdbb05686 (patch)
treeefdcc5245f0ff43b989440cc651bd22e556b422e /src/sp-cursor.cpp
parentreverting change to seltrans.cpp in rev 10935, as requested (diff)
downloadinkscape-1a7064b86be0898eead7323b94084ebfdbb05686.tar.gz
inkscape-1a7064b86be0898eead7323b94084ebfdbb05686.zip
cppchecktells us: Using signed char type as array index. If the value can be greater than 127 there will be a buffer overflow (because of sign extension).
-> treating symptoms (pointer conversion and error in case of issues) rather than disease (correct reading from beginning; prevented by string routines not accepting unsigned chars) (bzr r10937)
Diffstat (limited to 'src/sp-cursor.cpp')
-rw-r--r--src/sp-cursor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sp-cursor.cpp b/src/sp-cursor.cpp
index 7ccdaadbe..2069bddbd 100644
--- a/src/sp-cursor.cpp
+++ b/src/sp-cursor.cpp
@@ -145,7 +145,8 @@ GdkPixbuf *sp_cursor_pixbuf_from_xpm(gchar const *const *xpm, GdkColor const& bl
for (int i = 0; i < colors; i++) {
char const *p = xpm[1 + i];
- char const ccode = *p;
+ g_assert(*p >=0);
+ guchar const ccode = (guchar) *p;
p++;
while (isspace(*p)) {