/[base]
ViewVC logotype

Revision 275777


Jump to revision: Previous Next
Author: jilles
Date: Sun Dec 14 18:30:30 2014 UTC (9 years, 6 months ago)
Changed paths: 4
Log Message:
MFC r268576: sh: Correctly handle positional parameters beyond INT_MAX on
64-bit systems.

Currently, there can be no more than INT_MAX positional parameters. Make
sure to treat all higher ones as unset to avoid incorrect results and
crashes.

On 64-bit systems, our atoi() takes the low 32 bits of the strtol() and
sign-extends them.

On 32-bit systems, the call to atoi() returned INT_MAX for too high values
and there is not enough address space for so many positional parameters, so
there was no issue.

PR:		195918


Changed paths

Path Details
Directorystable/10/ modified , props changed
Directorystable/10/bin/sh/expand.c modified , text changed
Directorystable/10/bin/sh/tests/parameters/Makefile modified , text changed
Directorystable/10/bin/sh/tests/parameters/positional5.0
(Copied from head/bin/sh/tests/parameters/positional5.0, r268576)
added

  ViewVC Help
Powered by ViewVC 1.1.27