fixed compiler warnings issued by:

gcc 4.3
	curl.h gcc type-checking
	glibc with enabled FORTIFY_SOURCE checking
This commit is contained in:
Martin Willi
2008-11-11 18:37:19 +00:00
parent 3d2dbebd70
commit 479f295049
22 changed files with 125 additions and 59 deletions
@@ -215,9 +215,13 @@ static bool read_key(private_agent_private_key_t *this, public_key_t *pubkey)
chunk_t blob = chunk_from_buf(buf), key, type, tmp;
len = htonl(1);
write(this->socket, &len, sizeof(len));
buf[0] = SSH_AGENT_ID_REQUEST;
write(this->socket, &buf, 1);
if (write(this->socket, &len, sizeof(len)) != sizeof(len) ||
write(this->socket, &buf, 1) != 1)
{
DBG1("writing to ssh-agent failed");
return FALSE;
}
blob.len = read(this->socket, blob.ptr, blob.len);
@@ -275,20 +279,36 @@ static bool sign(private_agent_private_key_t *this, signature_scheme_t scheme,
}
len = htonl(1 + sizeof(u_int32_t) * 3 + this->key.len + data.len);
write(this->socket, &len, sizeof(len));
buf[0] = SSH_AGENT_SIGN_REQUEST;
write(this->socket, &buf, 1);
if (write(this->socket, &len, sizeof(len)) != sizeof(len) ||
write(this->socket, &buf, 1) != 1)
{
DBG1("writing to ssh-agent failed");
return FALSE;
}
len = htonl(this->key.len);
write(this->socket, &len, sizeof(len));
write(this->socket, this->key.ptr, this->key.len);
if (write(this->socket, &len, sizeof(len)) != sizeof(len) ||
write(this->socket, this->key.ptr, this->key.len) != this->key.len)
{
DBG1("writing to ssh-agent failed");
return FALSE;
}
len = htonl(data.len);
write(this->socket, &len, sizeof(len));
write(this->socket, data.ptr, data.len);
if (write(this->socket, &len, sizeof(len)) != sizeof(len) ||
write(this->socket, data.ptr, data.len) != data.len)
{
DBG1("writing to ssh-agent failed");
return FALSE;
}
flags = htonl(0);
write(this->socket, &flags, sizeof(flags));
if (write(this->socket, &flags, sizeof(flags)) != sizeof(flags))
{
DBG1("writing to ssh-agent failed");
return FALSE;
}
blob.len = read(this->socket, blob.ptr, blob.len);
if (blob.len < sizeof(u_int32_t) + sizeof(u_char) ||
@@ -123,7 +123,7 @@ static bool set_option(private_curl_fetcher_t *this, fetcher_option_t option, ..
case FETCH_REQUEST_DATA:
{
chunk_t data = va_arg(args, chunk_t);
curl_easy_setopt(this->curl, CURLOPT_POSTFIELDS, data.ptr);
curl_easy_setopt(this->curl, CURLOPT_POSTFIELDS, (char*)data.ptr);
curl_easy_setopt(this->curl, CURLOPT_POSTFIELDSIZE, data.len);
return TRUE;
}