Bug 197769 - env cores for a pretty simple expression
Summary: env cores for a pretty simple expression
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.0-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: Jilles Tjoelker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-17 20:18 UTC by KS Braunsdprf
Modified: 2015-03-15 12:00 UTC (History)
2 users (show)

See Also:
jilles: mfc-stable10+
jilles: mfc-stable9+
jilles: mfc-stable8-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description KS Braunsdprf 2015-02-17 20:18:47 UTC
XXX=-u env -v -u NAME -S '${XXX}\_NAME'

drops core.  I don't think it should drop core.

That is reduced from a much longer expression, of course.

--ksb
Comment 1 KS Braunsdprf 2015-02-23 20:36:31 UTC
In myt testing these all drop core.

 env -S '\c'
 env -S '#'
 env -S '#ls\_NAME'
 env -u this -u this -S "#alas pwd"

I found a few more, but you get the idea.  Mayhap I'll try to fix it.

--ksb
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-03-08 14:13:39 UTC
A commit references this bug:

Author: jilles
Date: Sun Mar  8 14:12:45 UTC 2015
New revision: 279779
URL: https://svnweb.freebsd.org/changeset/base/279779

Log:
  env: Fix crash when -S string is not empty but no operand follows.

  split_spaces() set argc in main() incorrectly, which caused trouble for
  getopt().

  Examples:
    env -S '\c'
    env -S -i

  PR:		197769
  MFC after:	1 week

Changes:
  head/tools/regression/usr.bin/env/regress-env.rgdata
  head/tools/regression/usr.bin/env/regress-sb.rb
  head/usr.bin/env/envopts.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-03-15 11:44:43 UTC
A commit references this bug:

Author: jilles
Date: Sun Mar 15 11:43:52 UTC 2015
New revision: 280027
URL: https://svnweb.freebsd.org/changeset/base/280027

Log:
  MFC r279779: env: Fix crash when -S string is not empty but no operand
  follows.

  split_spaces() set argc in main() incorrectly, which caused trouble for
  getopt().

  Examples:
    env -S '\c'
    env -S -i

  PR:		197769

Changes:
_U  stable/10/
  stable/10/tools/regression/usr.bin/env/regress-env.rgdata
  stable/10/tools/regression/usr.bin/env/regress-sb.rb
  stable/10/usr.bin/env/envopts.c
Comment 4 commit-hook freebsd_committer freebsd_triage 2015-03-15 11:57:50 UTC
A commit references this bug:

Author: jilles
Date: Sun Mar 15 11:56:53 UTC 2015
New revision: 280029
URL: https://svnweb.freebsd.org/changeset/base/280029

Log:
  MFC r279779: env: Fix crash when -S string is not empty but no operand
  follows.

  split_spaces() set argc in main() incorrectly, which caused trouble for
  getopt().

  Examples:
    env -S '\c'
    env -S -i

  PR:		197769

Changes:
_U  stable/9/tools/regression/usr.bin/env/
  stable/9/tools/regression/usr.bin/env/regress-env.rgdata
  stable/9/tools/regression/usr.bin/env/regress-sb.rb
_U  stable/9/usr.bin/env/
  stable/9/usr.bin/env/envopts.c