projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix bug #2770 - avoid length limit for auth parameters.
[yaz-moved-to-github.git]
/
src
/
tcpip.c
diff --git
a/src/tcpip.c
b/src/tcpip.c
index
97461da
..
715d0cf
100644
(file)
--- a/
src/tcpip.c
+++ b/
src/tcpip.c
@@
-610,8
+610,10
@@
int tcpip_rcvconnect(COMSTACK h)
gnutls_credentials_set (sp->session, GNUTLS_CRD_CERTIFICATE,
sp->cred_ptr->xcred);
gnutls_credentials_set (sp->session, GNUTLS_CRD_CERTIFICATE,
sp->cred_ptr->xcred);
- gnutls_transport_set_ptr(sp->session, (gnutls_transport_ptr_t) h->iofile);
-
+ /* cast to intermediate size_t to avoid GCC warning. */
+ gnutls_transport_set_ptr(sp->session,
+ (gnutls_transport_ptr_t)
+ (size_t) h->iofile);
res = gnutls_handshake(sp->session);
if (res < 0)
{
res = gnutls_handshake(sp->session);
if (res < 0)
{
@@
-965,8
+967,10
@@
COMSTACK tcpip_accept(COMSTACK h)
xfree(state);
return 0;
}
xfree(state);
return 0;
}
+ /* cast to intermediate size_t to avoid GCC warning. */
gnutls_transport_set_ptr(state->session,
gnutls_transport_set_ptr(state->session,
- (gnutls_transport_ptr_t) cnew->iofile);
+ (gnutls_transport_ptr_t)
+ (size_t) cnew->iofile);
}
#elif HAVE_OPENSSL_SSL_H
state->ctx = st->ctx;
}
#elif HAVE_OPENSSL_SSL_H
state->ctx = st->ctx;
@@
-1050,8
+1054,8
@@
int tcpip_get(COMSTACK h, char **buf, int *bufsize)
TRC(fprintf(stderr, "tcpip_get: bufsize=%d\n", *bufsize));
if (sp->altlen) /* switch buffers */
{
TRC(fprintf(stderr, "tcpip_get: bufsize=%d\n", *bufsize));
if (sp->altlen) /* switch buffers */
{
- TRC(fprintf(stderr, " %d bytes in altbuf (0x%x)\n", sp->altlen,
- (unsigned) sp->altbuf));
+ TRC(fprintf(stderr, " %d bytes in altbuf (%p)\n", sp->altlen,
+ sp->altbuf));
tmpc = *buf;
tmpi = *bufsize;
*buf = sp->altbuf;
tmpc = *buf;
tmpi = *bufsize;
*buf = sp->altbuf;
@@
-1156,8
+1160,8
@@
int tcpip_get(COMSTACK h, char **buf, int *bufsize)
h->cerrno = CSYSERR;
return -1;
}
h->cerrno = CSYSERR;
return -1;
}
- TRC(fprintf(stderr, " Moving %d bytes to altbuf(0x%x)\n", tomove,
- (unsigned) sp->altbuf));
+ TRC(fprintf(stderr, " Moving %d bytes to altbuf(%p)\n", tomove,
+ sp->altbuf));
memcpy(sp->altbuf, *buf + berlen, sp->altlen = tomove);
}
if (berlen < CS_TCPIP_BUFCHUNK - 1)
memcpy(sp->altbuf, *buf + berlen, sp->altlen = tomove);
}
if (berlen < CS_TCPIP_BUFCHUNK - 1)
@@
-1181,8
+1185,8
@@
int ssl_get(COMSTACK h, char **buf, int *bufsize)
TRC(fprintf(stderr, "ssl_get: bufsize=%d\n", *bufsize));
if (sp->altlen) /* switch buffers */
{
TRC(fprintf(stderr, "ssl_get: bufsize=%d\n", *bufsize));
if (sp->altlen) /* switch buffers */
{
- TRC(fprintf(stderr, " %d bytes in altbuf (0x%x)\n", sp->altlen,
- (unsigned) sp->altbuf));
+ TRC(fprintf(stderr, " %d bytes in altbuf (%p)\n", sp->altlen,
+ sp->altbuf));
tmpc = *buf;
tmpi = *bufsize;
*buf = sp->altbuf;
tmpc = *buf;
tmpi = *bufsize;
*buf = sp->altbuf;
@@
-1240,8
+1244,8
@@
int ssl_get(COMSTACK h, char **buf, int *bufsize)
} else if (sp->altsize < req)
if (!(sp->altbuf =(char *)xrealloc(sp->altbuf, sp->altsize = req)))
return -1;
} else if (sp->altsize < req)
if (!(sp->altbuf =(char *)xrealloc(sp->altbuf, sp->altsize = req)))
return -1;
- TRC(fprintf(stderr, " Moving %d bytes to altbuf(0x%x)\n", tomove,
- (unsigned) sp->altbuf));
+ TRC(fprintf(stderr, " Moving %d bytes to altbuf(%p)\n", tomove,
+ sp->altbuf));
memcpy(sp->altbuf, *buf + berlen, sp->altlen = tomove);
}
if (berlen < CS_TCPIP_BUFCHUNK - 1)
memcpy(sp->altbuf, *buf + berlen, sp->altlen = tomove);
}
if (berlen < CS_TCPIP_BUFCHUNK - 1)