X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/3ec4dd9781ed23be4a2b939fa5bfded619a1a8fb..dd04a03440be7c04ec7c3005d5fd92ec03311358:/uidlist.c diff --git a/uidlist.c b/uidlist.c index 962bb8c8..4aa098f8 100644 --- a/uidlist.c +++ b/uidlist.c @@ -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;