Mercurial > hg > freeDiameter
changeset 109:a522268ec95b
Less permissive in fd_dict_new
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Tue, 08 Dec 2009 14:03:44 +0900 |
parents | e2c3680b88f2 |
children | 0e21b85edf85 |
files | libfreeDiameter/dictionary.c |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libfreeDiameter/dictionary.c Tue Dec 08 13:52:32 2009 +0900 +++ b/libfreeDiameter/dictionary.c Tue Dec 08 14:03:44 2009 +0900 @@ -1383,6 +1383,14 @@ CHECK_PARAMS( ((struct dict_cmd_data *)data)->cmd_flag_mask & CMD_FLAG_REQUEST ); } + /* We have to check that the new values are not equal to the sentinels */ + if (type == DICT_VENDOR) { + CHECK_PARAMS( ((struct dict_vendor_data *)data)->vendor_id != 0 ); + } + if (type == DICT_APPLICATION) { + CHECK_PARAMS( ((struct dict_application_data *)data)->application_id != 0 ); + } + /* Parameters are valid, create the new object */ CHECK_MALLOC( new = malloc(sizeof(struct dict_object)) );