edward6018 / libnetconf

Automatically exported from code.google.com/p/libnetconf
Other
0 stars 0 forks source link

segfault in fill_default #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A larger running configuration returned at transapi_init of a transapi module 
is leading to a segfault in fill_default (src/with_defaults.c:612). Attached is 
the according valgrind.log.

During the recursion the variable created_local is reallocated. If the 
reallocation happens during the recursion, the pointer gets invalid.

What steps will reproduce the problem?
1. apply attached patch (0001-modified... to reduce initially allocated memory)
2. run netconf server

Proposed solution:
0001-pointer-made-static...patch makes the pointer static, thus reallocation 
works fine.

Original issue reported on code.google.com by tobias.j...@gmail.com on 7 Oct 2014 at 1:28

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by rkre...@cesnet.cz on 7 Oct 2014 at 2:23

GoogleCodeExporter commented 9 years ago
This issue was closed by revision ae1316888f8b.

Original comment by rkre...@cesnet.cz on 7 Oct 2014 at 2:30

GoogleCodeExporter commented 9 years ago
Thanks for reporting, Tobias. I made the code even more simple - since the 
created_local was static, there was no need for the fill_default()'s 'created' 
parameter, so I removed it. Again, thanks for nice report and good idea with 
making created_local static.

Original comment by rkre...@cesnet.cz on 7 Oct 2014 at 2:33

GoogleCodeExporter commented 9 years ago
Works perfectly fine. Again thanks for integrating the patch so fast!

Original comment by tobias.j...@gmail.com on 7 Oct 2014 at 3:13