jb_close(js);
jb_open_object(js, "iin");
- JsonDNP3LogIin(js, dnp3tx->response_iin.iin1 << 8 | dnp3tx->response_iin.iin2);
+ JsonDNP3LogIin(js, (uint16_t)(dnp3tx->response_iin.iin1 << 8 | dnp3tx->response_iin.iin2));
jb_close(js);
}
* \brief Write meta data on a single line json record
*/
static void FileWriteJsonRecord(JsonFileLogThread *aft, const Packet *p,
- const File *ff, uint32_t dir)
+ const File *ff, uint8_t dir)
{
HttpXFFCfg *xff_cfg = aft->filelog_ctx->xff_cfg != NULL ?
aft->filelog_ctx->xff_cfg : aft->filelog_ctx->parent_xff_cfg;;
TAILQ_FOREACH(response, &tx->response_list, next) {
/* handle multiple lines within the response, \r\n delimited */
uint8_t *where = response->str;
- uint16_t length = response->len ? response->len -1 : 0;
+ uint16_t length = 0;
uint16_t pos;
if (!reply_truncated && response->truncated) {
reply_truncated = true;
}
+ if (response->len > 0 && response->len <= UINT16_MAX) {
+ length = (uint16_t)response->len - 1;
+ } else if (response->len > UINT16_MAX) {
+ length = UINT16_MAX;
+ }
while ((pos = JsonGetNextLineFromBuffer((const char *)where, length)) != UINT16_MAX) {
uint16_t offset = 0;
/* Try to find a completion code for this line */
typedef struct OutputStatsCtx_ {
LogFileCtx *file_ctx;
- uint32_t flags; /** Store mode */
+ uint8_t flags; /** Store mode */
} OutputStatsCtx;
typedef struct JsonStatsLogThread_ {