Bug#299639: dash make make segdefault

2005-03-25 Thread Gerrit Pape
On Tue, Mar 15, 2005 at 05:15:11PM +0100, matthieu castet wrote:
 I am not sure it is a dash bug, but this bug don't happen with bash and
 posh.
 
 In dash if you do
 $ export CC=
 $ make
 Segmentation fault

Hi, I see two issues here.  The first is that dash puts 'CC' into the
environment and not 'CC=', which looks wrong to me:

$ env - dash -c 'export CC=; env'
PWD=/tmp
CC
$ 

The second is that make segfaults if it finds 'CC' in the environment as
you reported; I would consider that a bug in make.

Hi Herbert, I suggest the attached patch to fix the wrong environment.

Thanks, Gerrit.
Index: src/var.c
===
RCS file: /cvs/dash/src/var.c,v
retrieving revision 1.2
diff -u -r1.2 var.c
--- src/var.c   9 Jul 2004 19:10:17 -   1.2
+++ src/var.c   25 Mar 2005 08:10:23 -
@@ -232,7 +232,7 @@
INTOFF;
p = mempcpy(nameeq = ckmalloc(namelen + vallen + 2), name, namelen);
*p++ = '\0';
-   if (vallen) {
+   if (val) {
p[-1] = '=';
p = mempcpy(p, val, vallen);
}


Bug#299639: dash make make segdefault

2005-03-25 Thread Herbert Xu
On Fri, Mar 25, 2005 at 08:23:52AM +, Gerrit Pape wrote:
 
 Hi Herbert, I suggest the attached patch to fix the wrong environment.

Thanks Gerrit.  I've applied your patch.
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#299639: dash make make segdefault

2005-03-15 Thread matthieu castet
Package: dash
Version: 0.5.2-2
Severity: normal

Hi,

I am not sure it is a dash bug, but this bug don't happen with bash and
posh.

In dash if you do
$ export CC=
$ make
Segmentation fault

if you try to use gdb it work !!


Matthieu

PS the makefile do CC=gcc.


-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.11
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)

Versions of packages dash depends on:
ii  libc6   2.3.2.ds1-20 GNU C Library: Shared libraries an

-- debconf information:
* dash/sh: true


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]