libsunrpc: work around arm64 compiler bug in sunStringUnpack()
The sunStringUnpack() routine was miscompiled by 7c, as pointer arithmetic is done in 64 bit but the constant -1 offset got expended to a unsigned 32 bit integer.
This commit is contained in:
parent
9e1d26893f
commit
4a83ce37c6
1 changed files with 3 additions and 2 deletions
|
@ -428,8 +428,9 @@ sunStringUnpack(uchar *a, uchar *ea, uchar **pa, char **s, u32int max)
|
|||
goto Err;
|
||||
/* slide string down over length to make room for NUL */
|
||||
memmove(dat-1, dat, n);
|
||||
dat[-1+n] = 0;
|
||||
*s = (char*)(dat-1);
|
||||
dat--;
|
||||
dat[n] = 0;
|
||||
*s = (char*)dat;
|
||||
return 0;
|
||||
Err:
|
||||
return -1;
|
||||
|
|
Loading…
Reference in a new issue