fix auth read
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
bool quited = false;
|
||||
|
||||
bool fileread(void *ctx, char *into, uint32_t bytes) {
|
||||
return com_std_syscall(0, (intptr_t)ctx, (intptr_t)into, bytes);
|
||||
return com_std_syscall(0, (intptr_t)ctx, (intptr_t)into, bytes) == bytes;
|
||||
}
|
||||
|
||||
bool fileskip(void *ctx, uint32_t bytes) {
|
||||
@@ -63,11 +63,11 @@ static struct plr_x11_auth_entry {
|
||||
if (!com_bin_read_u16(b, &data_len))
|
||||
goto BREAK;
|
||||
uint32_t data_idx;
|
||||
if (!com_bin_read_bufbi(b, buf, &data_idx, name_len))
|
||||
if (!com_bin_read_bufbi(b, buf, &data_idx, data_len))
|
||||
goto BREAK;
|
||||
|
||||
result.auth_name = com_buf_index(struct com_buf, buf, name_idx);
|
||||
result.auth_data = com_buf_index(struct com_buf, buf, data_idx);
|
||||
result.auth_name = com_buf_index_as(struct com_buf, buf, name_idx);
|
||||
result.auth_data = com_buf_index_as(struct com_buf, buf, data_idx);
|
||||
result.success = true;
|
||||
return result;
|
||||
BREAK:
|
||||
|
||||
Reference in New Issue
Block a user