blob: fb76e2d2cc8a09b7af154cf8921076829f0d6889 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
$NetBSD: patch-aa,v 1.10 2008/07/03 22:14:50 tonnerre Exp $
--- libraries/liblber/io.c.orig 2008-02-12 00:26:41.000000000 +0100
+++ libraries/liblber/io.c
@@ -584,13 +584,11 @@ ber_get_next(
return LBER_DEFAULT;
}
/* Not enough bytes? */
- if (ber->ber_rwptr - (char *)p < llen) {
-#if defined( EWOULDBLOCK )
- sock_errset(EWOULDBLOCK);
-#elif defined( EAGAIN )
- sock_errset(EAGAIN);
-#endif
- return LBER_DEFAULT;
+ i = ber->ber_rwptr - (char *)p;
+ if (i < llen) {
+ sblen=ber_int_sb_read( sb, ber->ber_rwptr, i );
+ if (sblen<i) return LBER_DEFAULT;
+ ber->ber_rwptr += sblen;
}
for (i=0; i<llen; i++) {
tlen <<=8;
|