project-hatohol / hatohol

A unified manager of monitoring software
http://www.hatohol.org/
Other
89 stars 29 forks source link

[servers] Fix a crash when the number of items is zero. #2446

Closed kz0817 closed 7 years ago

kz0817 commented 7 years ago

syncItem() assumes there is at least one elements in an input list. Current implementation may cause crash if the list is empty. This patch avoids the crash by checking the number of elements.

ashie commented 7 years ago

Memo: getTargetHostId() is the root cause of the crash.