(send_and_recv_http): don't expose freed pointer, found by IBM checker.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16957 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -207,6 +207,7 @@ send_and_recv_http(int fd,
|
||||
s[rep->length] = 0;
|
||||
p = strstr(s, "\r\n\r\n");
|
||||
if(p == NULL) {
|
||||
krb5_data_zero(rep);
|
||||
free(s);
|
||||
return -1;
|
||||
}
|
||||
@@ -214,12 +215,14 @@ send_and_recv_http(int fd,
|
||||
rep->data = s;
|
||||
rep->length -= p - s;
|
||||
if(rep->length < 4) { /* remove length */
|
||||
krb5_data_zero(rep);
|
||||
free(s);
|
||||
return -1;
|
||||
}
|
||||
rep->length -= 4;
|
||||
_krb5_get_int(p, &rep_len, 4);
|
||||
if (rep_len != rep->length) {
|
||||
krb5_data_zero(rep);
|
||||
free(s);
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user