[Prelude Hybrid IDS] #269: Wrong idmef_*_get_next_* python binding functions?
"Prelude Hybrid IDS" <[email protected]>
| Newsgroups | gmane.comp.security.ids.prelude.devel |
|---|---|
| Message-ID | <[email protected]> |
#269: Wrong idmef_*_get_next_* python binding functions? ------------------------------------+--------------------------------------- Reporter: [email protected] | Owner: yoann Type: defect | Status: new Priority: normal | Milestone: Component: libprelude | Version: 0.9 Severity: normal | Keywords: python binding ------------------------------------+--------------------------------------- As much as I understood, idmef_alert_get_next_source has to be called with a NULL pointer as the second argument to get the first source in an alert ; other sources are retrieved by using the result of the function in subsequent calls. When using the python binding function, I guess I have to use "None" as the second argument. Actually, I get an exception when calling idmef_alert_get_next_source(idmefalert,None) in a python code. I have had a look at the following function in the _prelude.c python binding code: *_wrap_idmef_alert_get_next_source(PyObject *SWIGUNUSEDPARM(self), PyObject *args) It appears that when the second argument is "None", this function returns NULL: if ( obj1 == Py_None ) return NULL; I modified this function to invoke result = (idmef_source_t *)idmef_alert_get_next_source(arg1,(idmef_source_t *)NULL); when obj1 == Py_None and it seems to work fine. Actually, I had to do the same modifications in idmef_node_get_next_address and idmef_alert_get_next_target. I did not check other idmef_*_get_next_* functions, but they are likely to contain the same "bug". -- Ticket URL: <https://trac.prelude-ids.org/ticket/269> Prelude Hybrid IDS <http://www.prelude-ids.org> The Prelude Hybrid Intrusion Detection System suite _______________________________________________ Prelude-devel site list [email protected] http://www.prelude-ids.org/mailman/listinfo/prelude-devel