]> git.sur5r.net Git - openldap/commitdiff
ITS#8301 remove assert in ber_get_next
authorHoward Chu <hyc@openldap.org>
Thu, 5 Nov 2015 12:11:21 +0000 (12:11 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 5 Nov 2015 12:11:21 +0000 (12:11 +0000)
Just return error.

libraries/liblber/io.c

index c05dcf8434a42c5be71614da7e63e53c2f18cc6c..0726d82895e4b45f2e40a1151037a20d9e6a1d14 100644 (file)
@@ -656,7 +656,8 @@ ber_get_next(
                ber_slen_t to_go;
                
                to_go = ber->ber_end - ber->ber_rwptr;
-               assert( to_go > 0 );
+               /* unsigned/signed overflow */
+               if (to_go<0) return LBER_DEFAULT;
                
                sock_errset(0);
                res = ber_int_sb_read( sb, ber->ber_rwptr, to_go );