From: Howard Chu Date: Wed, 28 Sep 2005 08:36:24 +0000 (+0000) Subject: ITS#4046 fix recvfrom len X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~364 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0f9ad702c3776c8b2351ffc2e2e207b99879627f;p=openldap ITS#4046 fix recvfrom len --- diff --git a/libraries/liblber/sockbuf.c b/libraries/liblber/sockbuf.c index 4960c93bb4..c30469cdec 100644 --- a/libraries/liblber/sockbuf.c +++ b/libraries/liblber/sockbuf.c @@ -46,7 +46,7 @@ #define LBER_MIN_BUFF_SIZE 4096 #endif #ifndef LBER_MAX_BUFF_SIZE -#define LBER_MAX_BUFF_SIZE 65536 +#define LBER_MAX_BUFF_SIZE (65536*256) #endif #ifndef LBER_DEFAULT_READAHEAD #define LBER_DEFAULT_READAHEAD 16384 @@ -911,6 +911,7 @@ sb_dgram_read( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len ) addrlen = sizeof( struct sockaddr ); src = buf; buf += addrlen; + len -= addrlen; rc = recvfrom( sbiod->sbiod_sb->sb_fd, buf, len, 0, src, &addrlen ); return rc > 0 ? rc+sizeof(struct sockaddr) : rc;