Skip to content

Commit

Permalink
Fix off-by-one in nv_mktype() (Solaris patch 210-Bug15993811)
Browse files Browse the repository at this point in the history
This change is pulled from here:
https://github.com/oracle/solaris-userland/blob/master/components/ksh93/patches/210-Bug15993811.patch

Unfortunately there is no publicly available documentation on why
this change was needed. We just have to assume the Solaris people
knew what they were doing. ksh2020 upstreamed this too (as well as
all the other Solaris patches applied here).
  • Loading branch information
McDutchie committed Jan 8, 2021
1 parent ba4989d commit ad9ea0b
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/cmd/ksh93/sh/nvtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,6 @@ Namval_t *nv_mktype(Namval_t **nodes, int numnodes)
}
offset = roundof(offset,sizeof(char*));
nv_setsize(mp,offset);
if(nd)
nd++;
k = roundof(sizeof(Namtype_t),sizeof(Sfdouble_t)) - sizeof(Namtype_t);
pp = newof(NiL, Namtype_t, 1, nnodes*NV_MINSZ + offset + size + (nnodes+nd)*sizeof(char*) + iref*sizeof(struct Namref)+k);
pp->fun.dsize = sizeof(Namtype_t)+nnodes*NV_MINSZ +offset+k;
Expand Down

0 comments on commit ad9ea0b

Please sign in to comment.