Bug #261

wrong parameter used in ndo2db_db_query call in ndo2db_handle_acknowledgementdata

Added by brucep almost 7 years ago. Updated almost 7 years ago.

Status:ResolvedStart date:01/28/2010
Priority:HighDue date:
Assignee:mfriedrich% Done:


Category:Event Broker
Target version:1.0.1
Icinga Version: OS Version:


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.

Associated revisions

Revision 0b576e4d
Added by mfriedrich almost 7 years ago

fix acknowledgments query

wrong buffer freed/set as query to db

fixes #261


#1 Updated by mfriedrich almost 7 years ago

  • Assignee set to mfriedrich
  • Target version set to 1.0.1

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 :)

#2 Updated by mfriedrich almost 7 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF