diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-04-01 05:20:19 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-04-01 05:20:19 +0000 |
commit | 575f2fca9ab74cb30cca67323a414d7b0cdd0845 (patch) | |
tree | 44daa77e163900ac2c2d63e5ae750e94e9682feb /uidlist.c | |
parent | fc4e8d51ff374d442de010c2a7d3b55b57248d86 (diff) | |
download | rsync-575f2fca9ab74cb30cca67323a414d7b0cdd0845.tar.gz rsync-575f2fca9ab74cb30cca67323a414d7b0cdd0845.tar.bz2 rsync-575f2fca9ab74cb30cca67323a414d7b0cdd0845.zip |
fixed a string termination bug in the uidlist handling code. I've also
added a read_sbuf() routine that fixes this kind of bug generically to
avoid similar problems in future.
Diffstat (limited to 'uidlist.c')
-rw-r--r-- | uidlist.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -256,9 +256,9 @@ void recv_uid_list(int f, struct file_list *flist) id = read_int(f); while (id != 0) { int len = read_byte(f); - name = (char *)malloc(len); + name = (char *)malloc(len+1); if (!name) out_of_memory("recv_uid_list"); - read_buf(f, name, len); + read_sbuf(f, name, len); if (!list) { uidlist = add_list(id, name); list = uidlist; @@ -279,9 +279,9 @@ void recv_uid_list(int f, struct file_list *flist) id = read_int(f); while (id != 0) { int len = read_byte(f); - name = (char *)malloc(len); + name = (char *)malloc(len+1); if (!name) out_of_memory("recv_uid_list"); - read_buf(f, name, len); + read_sbuf(f, name, len); if (!list) { gidlist = add_list(id, name); list = gidlist; |