Comment 30 for bug 8254

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Mon, 20 Sep 2004 11:44:37 +0200
From: Bastian Blank <email address hidden>
To: Steve Langasek <email address hidden>, <email address hidden>
Subject: Re: Bug#272136: More progress about the "Arabic crash" in Debian Installer

--zS7rBR6csb6tI2e1
Content-Type: multipart/mixed; boundary="0vzXIDBeUiKkjNJl"
Content-Disposition: inline

--0vzXIDBeUiKkjNJl
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Sep 20, 2004 at 10:22:14AM +0200, Bastian Blank wrote:
> On Mon, Sep 20, 2004 at 12:49:57AM -0700, Steve Langasek wrote:
> > Please try the attached patch to slang.
> I did some cleanups on the patch.

Some further changes.

Bastian

--=20
One does not thank logic.
  -- Sarek, "Journey to Babel", stardate 3842.4

--0vzXIDBeUiKkjNJl
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment; filename=diff
Content-Transfer-Encoding: quoted-printable

diff -ur slang-1.4.9.orig/src/slsmg.c slang-1.4.9-utf8/src/slsmg.c
--- slang-1.4.9.orig/src/slsmg.c 2004-09-20 09:17:58.000000000 +0200
+++ slang-1.4.9-utf8/src/slsmg.c 2004-09-20 10:53:52.000000000 +0200
@@ -309,7 +309,8 @@
    if ((int) n < 0)
      return;
=20
- wptr =3D (wchar_t *)malloc(sizeof(wchar_t)*(n+1));
+ size_t wptr_len =3D n + 1;
+ wptr =3D malloc(sizeof(wchar_t) * wptr_len);
=20
    if (str !=3D NULL && wptr !=3D NULL)
    {
@@ -328,6 +329,14 @@
       str +=3D k;
       n -=3D w;
       i++;
+ /* We have some null-width chars in the string and need more space */
+ if (i >=3D wptr_len) {
+ wchar_t *new_wptr =3D realloc(wptr, sizeof(wchar_t) * wptr_len * 2);
+ if (!new_wptr)
+ break;
+ wptr_len *=3D 2;
+ wptr =3D new_wptr;
+ }
  }
  SLsmg_write_nwchars (wptr, i);
    }

--0vzXIDBeUiKkjNJl--

--zS7rBR6csb6tI2e1
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iEYEARECAAYFAkFOpoUACgkQnw66O/MvCNHWrgCfSLTv08f1G01pzaD3LcjgdSRX
dRAAn0RofHYmsbgqWz5OpXS7/hLt/xHj
=GtVp
-----END PGP SIGNATURE-----

--zS7rBR6csb6tI2e1--