modbus_new_rtu Segmentation Fault when device argument is NULL #184

FifteenFifty opened this Issue Dec 13, 2013 · 0 comments


None yet
1 participant

If the device argument to modbus_new_rtu is NULL, modbus_free is called on the context (src/modbus-rtu.c:1158).

Due to ctx->backend_data->device not having been malloc'd (this currently happens after the NULL device check), the free on line 1115 (src/modbus-rtu.c:1115) causes a segmentation fault.

@stephane stephane closed this in 55bd505 Dec 16, 2013

mk8 added a commit to mk8/libmodbus that referenced this issue Jan 29, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment