diff libfreeDiameter/dictionary.c @ 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 2db15632a63d
children 3b6174b6b35b
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))  );
 	
"Welcome to our mercurial repository"