Package: cgilib
Version: 0.6-1
Severity: important
Tags: patch
Content-Type: multipart/mixed; boundary="===============1572526208=="
MIME-Version: 1.0
From: deb...@igor2.repo.hu
To: Debian Bug Tracking System <sub...@bugs.debian.org>
X-Debug: to=sub...@bugs.debian.org from="mih...@igor2.repo.hu"
From: mih...@igor2.repo.hu
Subject: cgilib.patch: Typo in array indexing causes segfault on multi-value
 parameters
X-Debbugs-Cc: deb...@igor2.repo.hu

This is a multi-part MIME message sent by reportbug.


--===============1572526208==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Package: cgilib0.6-1
Severity: important
Tags: patch

Dear Maintainer,

   * What led up to the situation?

HTTP post parameter with the same name appears multiple times crashes
the lib in cgiInit() because of a typo in the array index of a debug
message.

   * What was the outcome of this action?

Segfault.


-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable'), (500, 'oldstable')
Architecture: i386 (i686)

Kernel: Linux 4.5.1retfie (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash
Init: sysvinit (via /sbin/init)

--===============1572526208==
Content-Type: text/x-diff; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="cgilib.patch"

diff -uri cgilib-0.6-orig/cgi.c cgilib-0.6/cgi.c
--- cgilib-0.6-orig/cgi.c       2017-03-31 08:49:39.000000000 +0200
+++ cgilib-0.6/cgi.c    2017-03-31 08:54:30.990919349 +0200
@@ -637,7 +637,7 @@
                free (result[k]->value);
                free (value);
                result[k]->value = sptr;
-               cgiDebugOutput (1, "%s: %s", result[i]->name, result[i]->value);
+               cgiDebugOutput (1, "%s: %s", result[k]->name, result[k]->value);
            }
        }
        cp = ++ip;

--===============1572526208==--

Reply via email to