Project

General

Profile

Actions

Bug #7194

closed
JL JL

output: jb context not closed on error in EvePacket

Bug #7194: output: jb context not closed on error in EvePacket

Added by Jeff Lucovsky over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

An error can leave an unclosed json-builder object unclosed:

void EvePacket(const Packet *p, JsonBuilder *js, unsigned long max_length)
{
    unsigned long max_len = max_length == 0 ? GET_PKT_LEN(p) : max_length;
    jb_set_base64(js, "packet", GET_PKT_DATA(p), max_len);

    if (!jb_open_object(js, "packet_info")) {
        return;
    }
    if (!jb_set_uint(js, "linktype", p->datalink)) {
        return;
    }
    jb_close(js);
}

If jb_set_uint were to fail, the object remains unclosed.

JL Updated by Jeff Lucovsky over 1 year ago Actions #1

  • Status changed from New to In Review

PA Updated by Philippe Antoine over 1 year ago Actions #2

  • Status changed from In Review to Closed
Actions

Also available in: PDF Atom