Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I3VCF-0003ox-Lj for qemu-devel@nongnu.org; Wed, 27 Jun 2007 06:56:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I3VCF-0003oj-6o for qemu-devel@nongnu.org; Wed, 27 Jun 2007 06:56:27 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I3VCE-0003oY-Tf for qemu-devel@nongnu.org; Wed, 27 Jun 2007 06:56:26 -0400 Received: from mx2.suse.de ([195.135.220.15]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I3VCE-0000bL-2x for qemu-devel@nongnu.org; Wed, 27 Jun 2007 06:56:26 -0400 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 9C10821486 for ; Wed, 27 Jun 2007 12:56:23 +0200 (CEST) From: Andreas Schwab Date: Wed, 27 Jun 2007 12:56:22 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] Fix environ termination Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Properly NULL-terminate the environment. Andreas. --- linux-user/main.c.~1.116.~ 2007-06-25 12:39:20.000000000 +0200 +++ linux-user/main.c 2007-06-27 12:51:43.000000000 +0200 @@ -1819,7 +1819,7 @@ int main(int argc, char **argv) continue; *(dst++) =3D strdup(*wrk); } - dst =3D NULL; /* NULL terminate target_environ */ + *dst =3D NULL; /* NULL terminate target_environ */ =20 if (loader_exec(filename, argv+optind, target_environ, regs, info) != =3D 0) { printf("Error loading %s\n", filename); --=20 Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstra=DFe 5, 90409 N=FCrnberg, Germany PGP key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED= 5 "And now for something completely different."