Hi

Our automated tests for FFmpeg (http://fate.ffmpeg.org/) have yesterday
found a segfault in openbsds /bin/sh.

Analysis revealed that it was triggered by too many variables
That is something like

#!/bin/sh

i=0
while true ; do
    eval X${i}=yes
    i=$(($i+1))
    test $i -gt 17000 && break
done

will segfault.

The following patch fixes it: (which we are currently using on our
openbsd fate client)

Index: table.h
===================================================================
RCS file: /cvs/src/bin/ksh/table.h,v
retrieving revision 1.7
diff -u -r1.7 table.h
--- table.h     11 Dec 2005 20:31:21 -0000      1.7
+++ table.h     30 Jan 2012 14:13:30 -0000
@@ -8,7 +8,7 @@

 struct table {
        Area   *areap;          /* area to allocate entries */
-       short   size, nfree;    /* hash size (always 2^^n), free entries */
+       int     size, nfree;    /* hash size (always 2^^n), free entries */
        struct  tbl **tbls;     /* hashed table items */
 };


Note, iam not subscribed so please CC flames to me

Thanks
--
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein

[demime 1.01d removed an attachment of type application/pgp-signature which had 
a name of signature.asc]

Reply via email to