mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
ITS#9124 Check we have data to process in Cancel Exop
This commit is contained in:
parent
97c145919d
commit
1dbf0e9441
@ -34,7 +34,8 @@ int cancel_extop( Operation *op, SlapReply *rs )
|
|||||||
Operation *o;
|
Operation *o;
|
||||||
int rc;
|
int rc;
|
||||||
int opid;
|
int opid;
|
||||||
BerElement *ber;
|
BerElementBuffer berbuf;
|
||||||
|
BerElement *ber = (BerElement *)&berbuf;
|
||||||
|
|
||||||
assert( ber_bvcmp( &slap_EXOP_CANCEL, &op->ore_reqoid ) == 0 );
|
assert( ber_bvcmp( &slap_EXOP_CANCEL, &op->ore_reqoid ) == 0 );
|
||||||
|
|
||||||
@ -43,12 +44,14 @@ int cancel_extop( Operation *op, SlapReply *rs )
|
|||||||
return LDAP_PROTOCOL_ERROR;
|
return LDAP_PROTOCOL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
ber = ber_init( op->ore_reqdata );
|
if ( op->ore_reqdata->bv_len == 0 ) {
|
||||||
if ( ber == NULL ) {
|
rs->sr_text = "empty request data field";
|
||||||
rs->sr_text = "internal error";
|
return LDAP_PROTOCOL_ERROR;
|
||||||
return LDAP_OTHER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ber_init2 uses reqdata directly, doesn't allocate new buffers */
|
||||||
|
ber_init2( ber, op->ore_reqdata, 0 );
|
||||||
|
|
||||||
if ( ber_scanf( ber, "{i}", &opid ) == LBER_ERROR ) {
|
if ( ber_scanf( ber, "{i}", &opid ) == LBER_ERROR ) {
|
||||||
rs->sr_text = "message ID parse failed";
|
rs->sr_text = "message ID parse failed";
|
||||||
return LDAP_PROTOCOL_ERROR;
|
return LDAP_PROTOCOL_ERROR;
|
||||||
|
Loading…
Reference in New Issue
Block a user