File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/supplemental/nanolib/ringbuffer Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -861,6 +861,10 @@ put_msgs_to_aio(ringBuffer_t *rb, nng_aio *aio)
861861{
862862 int ret = 0 ;
863863 int * list_len = NULL ;
864+ if (aio == NULL ) {
865+ log_error ("aio is NULL for RB_FULL_RETURN\n" );
866+ return -1 ;
867+ }
864868
865869 /* get all msgs and clean ringbuffer */
866870 nni_msg * * list = NULL ;
@@ -936,6 +940,11 @@ int ringBuffer_enqueue(ringBuffer_t *rb,
936940 }
937941 if (rb -> fullOp == RB_FULL_RETURN ) {
938942 log_info ("RB_FULL_RETURN" );
943+ if (aio == NULL ) {
944+ log_error ("Ring buffer is full but aio is NULL under RB_FULL_RETURN\n" );
945+ nng_mtx_unlock (rb -> ring_lock );
946+ return -1 ;
947+ }
939948 ret = put_msgs_to_aio (rb , aio );
940949 if (ret != 0 ) {
941950 log_error ("Ring buffer is full and put msgs to aio failed!\n" );
You can’t perform that action at this time.
0 commit comments