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
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)"
if(asprintf(&buf,"INSERT INTO %s %s"
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.
2010-01-28 21:35:43 +00:00 by mfriedrich 0b576e4
fix acknowledgments query
wrong buffer freed/set as query to db
Updated by mfriedrich on 2010-01-28 21:29:18 +00:00
thanks for debugging and pointing to the code. It's one of those things which have been rewritten due to useless unique constraint matching but did not happen while testing.
I will apply a quickfix right now :)
Updated by mfriedrich on 2010-01-28 21:45:05 +00:00
Applied in changeset commit:"0b576e4d452feed5f2241fcce27d0e6f009884f8".