(sec_read): more paranoia with return value from sec_get_data
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7874 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 1999 Kungliga Tekniska H<>gskolan
|
||||
* Copyright (c) 1998 - 2000 Kungliga Tekniska H<>gskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -232,9 +232,12 @@ sec_read(int fd, void *data, int length)
|
||||
data = (char*)data + len;
|
||||
|
||||
while(length){
|
||||
if(sec_get_data(fd, &in_buffer, data_prot) < 0)
|
||||
int ret;
|
||||
|
||||
ret = sec_get_data(fd, &in_buffer, data_prot);
|
||||
if (ret < 0)
|
||||
return -1;
|
||||
if(in_buffer.size == 0) {
|
||||
if(ret == 0 || in_buffer.size == 0) {
|
||||
if(rx)
|
||||
in_buffer.eof_flag = 1;
|
||||
return rx;
|
||||
|
Reference in New Issue
Block a user