Feature/app data buffer check (#79)

* Added comments and buffer overflow checks

* Removed backslashs from C-code.
This commit is contained in:
Roy Schneider
2020-04-28 15:45:03 +02:00
committed by GitHub
parent 89929ee802
commit 0abcbea971
20 changed files with 1588 additions and 635 deletions
+17
View File
@@ -62,6 +62,15 @@ PROP_TAG_DATA bacnet_object_device_property_tag_map[] = {
{ -1, -1 }
};
/**
* Search for the given index in the data list.
*
* @param data_list Pointer to the list.
* @param index Index to search for.
* @param default_ret Default return value.
*
* @return Value found or the default value.
*/
signed bacprop_tag_by_index_default(
PROP_TAG_DATA *data_list, signed index, signed default_ret)
{
@@ -80,6 +89,14 @@ signed bacprop_tag_by_index_default(
return pUnsigned ? pUnsigned : default_ret;
}
/**
* Return the value of the given property, if available.
*
* @param type Object type
* @param prop Property
*
* @return Value found or -1
*/
signed bacprop_property_tag(BACNET_OBJECT_TYPE type, signed prop)
{
switch (type) {