diff --git a/libraries/liblber/encode.c b/libraries/liblber/encode.c index c889e44ea4..6c8b30aa8d 100644 --- a/libraries/liblber/encode.c +++ b/libraries/liblber/encode.c @@ -504,6 +504,8 @@ ber_put_seqorset( BerElement *ber ) assert( ber != NULL ); assert( LBER_VALID( ber ) ); + if( *sos == NULL ) 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