- avoid uneccessary memory allocations
- move {read,write}FileContent functions to usb source file where they are used exclusively and make them static
- fix bad logic in readFileContent
- move redundant code to static functions
- fix get_USBUSBHostsHostDevice_MaxChildren never returning any value
- fix no interface instances being created
- make some functions that are not exported static
- fix segfault on get_USBInterface_Enable when the interface is down
- fix segfault on get_USBInterface_Status when the interface is down.
- fix segfault on missing format character in get_USBInterface_LowerLayers.
- fix segfault and double frees on recrusive browseUSBUSBHostsHostInst() calls.
- reduce overall memory usage
- use const on read-only values
- fix invalid comparision on strstr return value
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
This fixes segfaults and pointers with invalid strings for:
- dmuci_add_section
- dmuci_set_value_by_section
- dmuci_set_value
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
Update fsize by the actual read bytes from fread,
because ftell will always return 4k on sysfs files.
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
Use unified function 'dmmap_file_path_get' and reuse it in
every function where the segfault occured.
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
- Changes done in Bridging.Bridge.X.Port, Bridging.Bridge.X.VLAN Objects
- Changes done in IP.Interface Objects
- Changes done in Ethernet Objects
TODO : Few more deployments needs to be covered. Also to add supoort for
VLANPort and VLANTermination.
- remove unused variables
- fix coding style of most function (Indentation, Tabulation, ..)
- check the source code using cppcheck tool
- change sprintf by snprintf