Set padding bytes to 0 in WriteToClient
Clear them out when needed instead of leaving whatever values were present in previously sent messages. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
parent
1622dd8ab2
commit
bed610fcae
6
os/io.c
6
os/io.c
|
@ -815,7 +815,11 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
|
|||
NewOutputPending = TRUE;
|
||||
FD_SET(oc->fd, &OutputPending);
|
||||
memmove((char *) oco->buf + oco->count, buf, count);
|
||||
oco->count += count + padBytes;
|
||||
oco->count += count;
|
||||
if (padBytes) {
|
||||
memset(oco->buf + oco->count, '\0', padBytes);
|
||||
oco->count += padBytes;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user