NordicPlayground / nRF51-ble-bcast-mesh

Other
323 stars 121 forks source link

Requesting value of handle that isn't in cache over UART enters hardfault handler #170

Open thedjnK opened 7 years ago

thedjnK commented 7 years ago

If you request the value of a handle that isn't on the node using the UART interface then the node will stop responding entirely because it enters the hardfault handler. This looks to be because you are passing in a maximum allowable size to the rbc_mesh_value_get() function in mesh_aci.c and expecting it to be reduced when the value is returned, however as the value isn't in the cache this length value will not be changed. Setting the length to e.g. 2 when there is an error prevents the crash. I haven't looked further to see if it's a memcpy or something else that is causing the hardfault due to an invalid pointer.

A additional nice idea would be to link the maximum serial string length with the maximum size of mesh values, by default it's fixed at 36 bytes in serial_handler.h therefore if you increase the mesh payload size you'd then need to search through the serial header files to find and change that maximum length too.