Mercurial > hg > freeDiameter
changeset 1252:5c6e94202c64
Fix dump of Failed-AVP content as a value is set while the model is not
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Mon, 13 Jan 2014 16:35:42 +0100 |
parents | bdd7bf840c8d |
children | b469d38e20fd |
files | libfdproto/dictionary.c |
diffstat | 1 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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;