diff --git a/directory/c-sdk/ldap/libraries/liblber/encode.c b/directory/c-sdk/ldap/libraries/liblber/encode.c index 0fe2e752413..6adff1ee95e 100644 --- a/directory/c-sdk/ldap/libraries/liblber/encode.c +++ b/directory/c-sdk/ldap/libraries/liblber/encode.c @@ -420,6 +420,13 @@ ber_put_seqorset( BerElement *ber ) Seqorset *next; Seqorset **sos = &ber->ber_sos; + if ( *sos == NULL ) { + /* + * No sequence or set to put... fatal error. + */ + return( -1 ); + } + /* * If this is the toplevel sequence or set, we need to actually * write the stuff out. Otherwise, it's already been put in