Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug #1435 (data loss when dumping payloads to JSON) v3 #1464

Closed
wants to merge 1 commit into from
Closed

Fix bug #1435 (data loss when dumping payloads to JSON) v3 #1464

wants to merge 1 commit into from

Conversation

gozzy
Copy link
Contributor

@gozzy gozzy commented May 7, 2015

Fixed #1455 - use MemBufferWriteRaw() wrapper instead of memcpy. Also fixed MemBufferWriteRaw() - there was unneeded return stetement.

@gozzy gozzy changed the title Fix bug #1435 (data loss when dumping payloads to JSON) Fix bug #1435 (data loss when dumping payloads to JSON) v3 May 7, 2015
unsigned char encoded[len];
Base64Encode(packet_buf, offset, encoded, &len);
Base64Encode(p->payload, p->payload_len, encoded, &len);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

output-json-alert.c: In function ‘AlertJson’:
output-json-alert.c:301:21: error: passing argument 4 of ‘Base64Encode’ from incompatible pointer type [-Werror]
util-crypt.h:82:5: note: expected ‘long unsigned int *’ but argument is of type ‘size_t *’
cc1: all warnings being treated as errors

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit strange - my compiler doesn't see anything suspicious.
Maybe we should return unsigned long here? For instance, LogTlsLogPem() uses unsigned long when calling Base64Encode.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably yeah. size_t is 4 bytes for 32bit args, 8bytes for 64bit args.

@gozzy
Copy link
Contributor Author

gozzy commented May 7, 2015

Replaced with #1468

@gozzy gozzy closed this May 7, 2015
@gozzy gozzy deleted the eve_payload_fix_v3 branch May 9, 2015 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants