Skip to content

Comments

Fix id format in json output log.#1052

Merged
vikman90 merged 1 commit intowazuh:3.6from
gandalfn:master
Sep 3, 2018
Merged

Fix id format in json output log.#1052
vikman90 merged 1 commit intowazuh:3.6from
gandalfn:master

Conversation

@gandalfn
Copy link
Contributor

@gandalfn gandalfn commented Aug 2, 2018

When writing rule id in json alerts file, the id is truncated and can be non unique, on intensive alerts generation.
This is due snprintf buffer size which is too small to store id. Indeed id is composed of two long int (timestamp and log offset) then the size can be to 21 characters (10 digits for both timestamp and offset + the dot)
The fix set id buffer to the correct size, and snprintf max size.

ddpbsd added a commit to ddpbsd/ossec-hids that referenced this pull request Aug 3, 2018
  When writing rule id in json alerts file, the id is truncated and can be non unique, on intensive alerts generation.
  This is due snprintf buffer size which is too small to store id. Indeed id is composed of two long int (timestamp and log offset) then the size can be to 21 characters (10 digits for both timestamp and offset + the dot)
  The fix set id buffer to the correct size, and snprintf max size.

wazuh/wazuh#1052

I'm not positive this affects us, but it probably doesn't hurt.
@crolopez crolopez requested review from crolopez and vikman90 August 30, 2018 09:01
@crolopez crolopez changed the base branch from master to 3.6 August 30, 2018 09:04
@vikman90 vikman90 added the type/bug Something isn't working label Aug 30, 2018
@vikman90 vikman90 merged commit c7fd964 into wazuh:3.6 Sep 3, 2018
@vikman90
Copy link
Member

vikman90 commented Sep 3, 2018

Hi @gandalfn,

Thank you very much for your contribution!
This fix will be available in the next Wazuh 3.6.1.

Best regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants