mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
ITS#6344: return failure on failure in ber_put_ostring()/ber_put_bitstring()
This commit is contained in:
parent
0db0fc22ec
commit
068cf1c701
1 changed files with 5 additions and 4 deletions
|
|
@ -151,6 +151,7 @@ ber_encode_oid( BerValue *in, BerValue *out )
|
||||||
der[j] = tmp;
|
der[j] = tmp;
|
||||||
}
|
}
|
||||||
der += len;
|
der += len;
|
||||||
|
|
||||||
if ( ptr == inend )
|
if ( ptr == inend )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -242,10 +243,10 @@ ber_put_ostring(
|
||||||
rc = ber_write( ber, (char *) ptr, &header[sizeof(header)] - ptr, 0 );
|
rc = ber_write( ber, (char *) ptr, &header[sizeof(header)] - ptr, 0 );
|
||||||
if ( rc >= 0 && ber_write( ber, str, len, 0 ) >= 0 ) {
|
if ( rc >= 0 && ber_write( ber, str, len, 0 ) >= 0 ) {
|
||||||
/* length(tag + length + contents) */
|
/* length(tag + length + contents) */
|
||||||
rc += (int) len;
|
return rc + (int) len;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
@ -300,10 +301,10 @@ ber_put_bitstring(
|
||||||
rc = ber_write( ber, (char *) ptr, &header[sizeof(header)] - ptr, 0 );
|
rc = ber_write( ber, (char *) ptr, &header[sizeof(header)] - ptr, 0 );
|
||||||
if ( rc >= 0 && ber_write( ber, str, len, 0 ) >= 0 ) {
|
if ( rc >= 0 && ber_write( ber, str, len, 0 ) >= 0 ) {
|
||||||
/* length(tag + length + unused bit count + bitstring) */
|
/* length(tag + length + unused bit count + bitstring) */
|
||||||
rc += (int) len;
|
return rc + (int) len;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue