memset in wrong place in modbus_mapping_new()

Bug #613531 reported by Dominic Storey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libmodbus
Fix Committed
Medium
Stéphane Raimbault

Bug Description

Looking at the source code in lieu of documentation (:-) ) I found that in modbus_mapping_new(), line 1818, you call malloc(), then memset() to clear the allocated memory (1820), then check to see if the malloc() was successful (1822). If malloc() fails, wont the memset() cause a core dump?

Revision history for this message
Stéphane Raimbault (sra) wrote :

Already fixed on master branch!

Changed in libmodbus:
status: New → Invalid
status: Invalid → Fix Committed
importance: Undecided → Medium
assignee: nobody → Stéphane Raimbault (sra)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.