diff --git a/source/libsmb/clistr.c b/source/libsmb/clistr.c index 93361053e0d..13bf1f05b7a 100644 --- a/source/libsmb/clistr.c +++ b/source/libsmb/clistr.c @@ -47,7 +47,7 @@ int clistr_push(struct cli_state *cli, void *dest, const char *src, int dest_len if (!(flags & STR_ASCII) && clistr_align(cli->outbuf, dest)) { *(char *)dest = 0; - dest++; + dest = (void *)((char *)dest + 1); dest_len--; len++; } @@ -96,7 +96,7 @@ int clistr_pull(struct cli_state *cli, char *dest, const void *src, int dest_len } if (!(flags & STR_ASCII) && clistr_align(cli->inbuf, src)) { - src++; + src = (void *)((char *)src + 1); if (src_len > 0) src_len--; } diff --git a/source/smbd/srvstr.c b/source/smbd/srvstr.c index 241a74f02f0..55cbada10c5 100644 --- a/source/smbd/srvstr.c +++ b/source/smbd/srvstr.c @@ -49,7 +49,7 @@ int srvstr_push(void *outbuf, void *dest, const char *src, int dest_len, int fla if (!(flags & STR_ASCII) && srvstr_align(outbuf, PTR_DIFF(dest, outbuf))) { *(char *)dest = 0; - dest++; + dest = (void *)((char *)dest + 1); dest_len--; len++; } @@ -98,7 +98,7 @@ int srvstr_pull(void *inbuf, char *dest, const void *src, int dest_len, int src_ } if (!(flags & STR_ASCII) && srvstr_align(inbuf, PTR_DIFF(src, inbuf))) { - src++; + src = (void *)((char *)src + 1); if (src_len > 0) src_len--; }