intel / openlldp

Other
54 stars 42 forks source link

lldptool: fix null pointer deference #88

Closed gaoxingwang closed 1 year ago

gaoxingwang commented 1 year ago

fix https://github.com/intel/openlldp/issues/87

gaoxingwang commented 1 year ago

PTAL @orgcandman

apconole commented 1 year ago

How did you generate this error? I assume that if an issue occurs during weak_readline_init then the rl_handle variable is reinitialized to NULL. Were you able to reproduce?

I think there is room for cleanup, but I'm curious if this is cleanup or if you observed a real issue here (which would point to some kind of race condition).

gaoxingwang commented 1 year ago

How did you generate this error? I assume that if an issue occurs during weak_readline_init then the rl_handle variable is reinitialized to NULL. Were you able to reproduce?

Yes, on my linux virtual machine, this problem is a constant occurrence. Function weak_readline_init fails here,and the rl_handle variable is NULL.

    hist_handle = dlopen("libhistory.so", RTLD_LAZY | RTLD_GLOBAL);                                                                                                                                               
    if (!hist_handle)
        return;
apconole commented 1 year ago

Thanks!