# HG changeset patch # User Sebastien Decugis # Date 1389627342 -3600 # Node ID 5c6e94202c6417595091a3a5c1ad3857c0a5b517 # Parent bdd7bf840c8dae9980f0945d8f63f68c0cdda773 Fix dump of Failed-AVP content as a value is set while the model is not diff -r bdd7bf840c8d -r 5c6e94202c64 libfdproto/dictionary.c --- a/libfdproto/dictionary.c Mon Jan 13 16:11:00 2014 +0100 +++ b/libfdproto/dictionary.c Mon Jan 13 16:35:42 2014 +0100 @@ -1510,8 +1510,21 @@ FD_DUMP_HANDLE_OFFSET(); - /* Check the parameters are correct */ - CHECK_PARAMS_DO( avp_value && verify_object(model) && (model->type == DICT_AVP), return NULL ); + /* Handle invalid parameters */ + if (!avp_value) { + CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "(avp value not set)"), return NULL); + return *buf; + } + + if (!model) { + CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "(model not set)"), return NULL); + return *buf; + } + + if (! ( verify_object(model) && (model->type == DICT_AVP) )) { + CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "(invalid model)"), return NULL); + return *buf; + } /* Get the type definition of this AVP */ type = model->parent;