This repository has been archived by the owner on Jan 15, 2019. It is now read-only.
[dev.icinga.com #261] wrong parameter used in ndo2db_db_query call in ndo2db_handle_acknowledgementdata #113
Labels
Milestone
This issue has been migrated from Redmine: https://dev.icinga.com/issues/261
Created by brucep on 2010-01-28 19:38:58 +00:00
Assignee: mfriedrich
Status: Resolved (closed on 2010-01-28 21:45:05 +00:00)
Target Version: 1.0.1
Last Update: 2010-01-28 21:45:05 +00:00 (in Redmine)
In dbhandlers.c, approx. line 3419, the call to ndo2db_db_query is wrong. Here is the relevant code:
if(asprintf(&buf1,"(instance_id, entry_time, entry_time_usec, acknowledgement_type, object_id, state, author_name, comment_data, is_sticky, persistent_comment, notify_contacts) VALUES (%lu, %s, %lu, %d, %lu, %d, '%s', '%s', %d, %d, %d)"
,idi->dbinfo.instance_id
,ts[0]
,tstamp.tv_usec
,acknowledgement_type
,object_id
,state
,es[0]
,es[1]
,is_sticky
,persistent_comment
,notify_contacts
)==-1)
buf1=NULL;
if(asprintf(&buf,"INSERT INTO %s %s"
,ndo2db_db_tablenames[NDO2DB_DBTABLE_ACKNOWLEDGEMENTS]
,buf1
)==-1)
buf=NULL;
free(buf1);
result = ndo2db_db_query(idi, buf1);
The call to ndo2db_db_query() should be passing buf as the second parameter, not buf1. There's also an extra call to free(buf1) slightly further down in the code.
Changesets
2010-01-28 21:35:43 +00:00 by mfriedrich 0b576e4
The text was updated successfully, but these errors were encountered: