Package: inkscape
Version: 0.48.3.1-1.3
Followup-For: Bug #728354

Dear Maintainer,

I was able to fix the problem.
Patch attached.

Cheers

P.S. The branch master.wip is missing

$ cat debian/gbp.conf
 debian-branch = master.wip

$ git branch -r
  origin/HEAD -> origin/master
  origin/master
  origin/pristine-tar
  origin/upstream
>From 32d391e4fac4a65bbb8377d844f014ffa0c6ed95 Mon Sep 17 00:00:00 2001
From: Vasil Velichkov <vvvelich...@gmail.com>
Date: Thu, 31 Oct 2013 05:03:11 +0200
Subject: [PATCH] Properly check gv_standard_colors array bounds

This fixes a segmentation fault.

Closes: #728354
---
 src/libcroco/cr-rgb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libcroco/cr-rgb.c b/src/libcroco/cr-rgb.c
index 893c208..b7f89a5 100644
--- a/src/libcroco/cr-rgb.c
+++ b/src/libcroco/cr-rgb.c
@@ -418,14 +418,14 @@ cr_rgb_set_from_name (CRRgb * a_this, const guchar * a_color_name)
 
         g_return_val_if_fail (a_this && a_color_name, CR_BAD_PARAM_ERROR);
 
-        for (i = 0; i < sizeof (gv_standard_colors); i++) {
+        for (i = 0; i < (sizeof (gv_standard_colors) / sizeof (gv_standard_colors[0])); i++) {
                 if (!strcmp ((char *)a_color_name, gv_standard_colors[i].name)) {
                         cr_rgb_set_from_rgb (a_this, &gv_standard_colors[i]);
                         break;
                 }
         }
 
-        if (i < sizeof (gv_standard_colors))
+        if (i < (sizeof (gv_standard_colors) / sizeof (gv_standard_colors[0])))
                 status = CR_OK;
         else
                status = CR_UNKNOWN_TYPE_ERROR;
-- 
1.7.10.4

Reply via email to