NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/52348: sh (alias.c:271) invokes undefined behaviour



The following reply was made to PR bin/52348; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: coypu%sdf.org@localhost, gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/52348: sh (alias.c:271) invokes undefined behaviour
Date: Thu, 29 Jun 2017 11:58:04 +0700

     Date:        Thu, 29 Jun 2017 01:50:00 +0000 (UTC)
     From:        coypu%sdf.org@localhost
     Message-ID:  <20170629015000.BADCE7A1FC%mollari.NetBSD.org@localhost>
 
   | alias.c:271:15: runtime error: left shift of negative value -126
 
 There is an easy (and obvious) fix for this, but I suspect that it
 might possibly indicate a deeper problem (the -126 looks like the shell's
 internal "variable reference follows" marker, rather than a character
 that should be appearing in an alias name.   If so it should be long
 gone before it gets to the code in question.
 
 But any char can occur in sh input, so I don't know if perhaps that
 char (0x82) was actually in the input or not.
 
 Can you tell me what the actual input was that causes this problem?
 
 That is, "problem" such as it is, << of a small negative number might not
 be a defined operation, but in practice works anywhere - and here we don't care
 what value is obtained, it is just constructing a hash value from the name.)
 
 kre
 


Home | Main Index | Thread Index | Old Index