X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fmessaging%2Fdefault_cb.cpp;fp=src%2Fmessaging%2Fdefault_cb.cpp;h=681f5f6eaaabed5f1ca657908d9998b7e03b6a98;hb=c85ac8bccf13f6aba024fef47453f3e1b6c3c615;hp=2156ad32eae3864f2fbc9dabc6a1405bb7736ee2;hpb=b0c88ede74392fc3d73270c3b9a545b7e641d9ab;p=ric-plt%2Fxapp-frame-cpp.git diff --git a/src/messaging/default_cb.cpp b/src/messaging/default_cb.cpp index 2156ad3..681f5f6 100644 --- a/src/messaging/default_cb.cpp +++ b/src/messaging/default_cb.cpp @@ -48,10 +48,18 @@ namespace xapp { The mr paramter is obviously ignored, but to add this as a callback the function sig must match. + + This is a callback function; sonar will complain that we don't use payload or + data -- we don't, but this is a standard function proto so we cannot just + drop them. */ void Health_ck_cb( Message& mbuf, int mtype, int sid, int len, Msg_component payload, void* data ) { unsigned char response[128]; + if( len < 0 || mtype < 0 ) { + return; + } + snprintf( (char* ) response, sizeof( response ), "OK\n" ); mbuf.Send_response( RIC_HEALTH_CHECK_RESP, sid, strlen( (char *) response )+1, response ); }