diff options
author | rsc <devnull@localhost> | 2006-05-04 18:54:09 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-05-04 18:54:09 +0000 |
commit | 1e22e8e41463896755b37d45bf76e14683e30f94 (patch) | |
tree | a7c08cd30ab7a44c1c0ccf2cd53b3c4a4be488c1 /src/libsunrpc | |
parent | 80b4aedc11325793331a7bffb46e32ae3f9af8ac (diff) | |
download | plan9port-1e22e8e41463896755b37d45bf76e14683e30f94.tar.gz plan9port-1e22e8e41463896755b37d45bf76e14683e30f94.tar.bz2 plan9port-1e22e8e41463896755b37d45bf76e14683e30f94.zip |
sign extension bug
Diffstat (limited to 'src/libsunrpc')
-rw-r--r-- | src/libsunrpc/rpc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libsunrpc/rpc.c b/src/libsunrpc/rpc.c index bf042317..4ebe1ec8 100644 --- a/src/libsunrpc/rpc.c +++ b/src/libsunrpc/rpc.c @@ -439,9 +439,10 @@ sunstringunpack(uchar *a, uchar *ea, uchar **pa, char **s, u32int max) if(sunvaropaqueunpack(a, ea, pa, &dat, &n, max) < 0) goto Err; /* slide string down over length to make room for NUL */ - memmove(dat-1, dat, n); - dat[n-1] = 0; - *s = (char*)(dat-1); + dat--; + memmove(dat, dat+1, n); + dat[n] = 0; + *s = (char*)dat; return 0; Err: return -1; |