[sword-devel] installmgr (and xiphos) crashes (svn 2831)
Jaak Ristioja
jaak at ristioja.ee
Thu Jun 27 07:15:07 MST 2013
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I think you only fixed pBuf not being set to NULL prematurely. But this:
memset(possibleName, 0, 400);
doesn't help. The sprintf function always writes a terminating \0
character. The problem is not that a \0 character is not written,
because it is written (unless a memory error occurs first). The
problem is that if possibleNameLength > 399 then it writes the
characters (including the terminating \0 character) past the end of
the possibleName buffer, corrupting memory, potentially outside of the
virtual address space of the program (usually triggering the OS to
kill the process with a segfault or something).
The memset call is not needed, but it should be checked that
possibleNameLength < 400 (strictly "less-than"). Otherwise
sprintf(possibleName, "%.*s", possibleNameLength, pBuf);
is a security vulnerability. I wonder whether a CVE is required.
Blessings,
Jaak
On 27.06.2013 14:45, Mark Trompell wrote:
> Sending again with tabs instead of blancs in the first hunk
>
> On Thu, Jun 27, 2013 at 1:17 PM, Mark Trompell
> <mark at foresightlinux.org> wrote:
>> I just fixed it :). Attached patch will initialize possibleNames
>> with 0 bytes to make sure we always have the name 0 terminated
>> properly. and it will move the pBuf=pBufRes into the check for
>> ifBufRes != NULL, in case no filesize is found (because of
>> another apache is displaying it differently) Shouldn't break
>> existing setups.
>
>
>
>
> _______________________________________________ sword-devel
> mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel Instructions
> to unsubscribe/change your settings at above page
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
iQgcBAEBAgAGBQJRzEjkAAoJEEqsYmEt1rCOCs4//2CXZeOyKAPtzSDMuXThEdlz
BJqSN/p1/GRdut0/hT3FZWmf2pF8rmEmy4MrptdQFovQh8Ek9KD1gxH9KrXboyd3
HYXdWTcNkUTviKWoyVPIaL/x4xJZgKlN0zJZ8gNwRRgxCjyUzyIe6FqoQA3gjabO
eUXrl2KMx4TSXI5/wOiOrOSTLYEtCrey+hwdSUWOux8tf/sWuzP8YOMGuNbws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UPGyl6IAept1uih5KGosyiyyo
5+U/nMT/QOOXNE1D7eFvt4vIPRu08s0pQlTXERbRQdQQxHYpesOKKL/65lRo/JWR
v7imshyWHHBUU3e3aLW+NCfVtHQVHHiF9ymPFfyO0v8wlpYGv4QRvWVr+DQ2/FsY
y6kr5Bw50L19xBZZh9esPq7sJ7RHFRgYjOg20oLpf8nRr+UBc9ViWAxSFORdNUMh
BZ9yuR18p0Rg13bRHXi5AQP6e0WefCz28xZ+3fJUYoR5PQgNWEPlvt4W3EIE3kt9
DPPI4sPXfpoMxpUH7Z5NrgHH8DEOzOPkXxv5fnp07xf76Bz6SztZE4+IHR7BATjr
rleT5NVP+FegC227npPx
=csMN
-----END PGP SIGNATURE-----
More information about the sword-devel
mailing list