Skip to content
This repository

Fix a segfault in TextLog_Print() by using %d for classification ID, as it's a 'uint32_t'. #68

Merged
merged 1 commit into from over 1 year ago

3 participants

Reed Loden Eric Lauzon Ian Firns
Reed Loden

No description provided.

Reed Loden
(gdb) bt full
#0  0x00007ffff6cfb3b1 in vfprintf () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1  0x00007ffff6d23442 in vsnprintf () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2  0x0000000000444f33 in TextLog_Print (this=0x6be4d0, fmt=0x449580 "[Classification ID: %s] [Priority ID: %d] ") at sf_textlog.c:215
        avail = 4020
        len = 4513238
        ap = {{gp_offset = 24, fp_offset = 48, overflow_arg_area = 0x7fffffffde60, reg_save_area = 0x7fffffffdd90}}
#3  0x00000000004126a8 in LogPriorityData (log=0x6be4d0, classification_id=4, priority_id=2, doNewLine=0) at log_text.c:94
        cn = 0x0
#4  0x0000000000428e20 in AlertFast (p=0x6f8160, event=0x6f7dc0, event_type=7, arg=0x6bdb70) at spo_alert_fast.c:199
        data = 0x6bdb70
        sn = 0x6f80b0
#5  0x000000000041d969 in CallOutputPlugins (out_type=OUTPUT_TYPE__SPECIAL, packet=0x6f8160, event=0x6f7dc0, event_type=7) at plugbase.c:566
        idx = 0x6bdbd0
#6  0x000000000041ebf3 in spoolerProcessRecord (spooler=0x6bf510, fire_output=1) at spooler.c:701
        event_id = 41939
        pkth = {ts = {tv_sec = 1360041619, tv_usec = 638257}, caplen = 74, len = 74}
        type = 2
        ernCache = 0x6f8080
#7  0x000000000041e731 in ProcessContinuous (dirpath=0x6bcacc "/var/log/barnyard2", filebase=0x6bcecc "unified2.alert", record_start=0, timestamp=1359020742) at spooler.c:533
        spooler = 0x6bf510
        ret = 0
        pc_ret = 0
        new_file_available = 0
        waiting_logged = 0
        skipped = 0
        extension = 1359020741
        waldo_timestamp = 1359020741
#8  0x000000000041e956 in ProcessContinuousWithWaldo (waldo=0x6bc6c4) at spooler.c:621
No locals.
#9  0x0000000000403d62 in Barnyard2Main (argc=14, argv=0x7fffffffe178) at barnyard2.c:374
No locals.
#10 0x0000000000403b8a in main (argc=14, argv=0x7fffffffe178) at barnyard2.c:285
No locals.
Eric Lauzon
Ian Firns firnsy merged commit dfc81fa into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Feb 05, 2013
Reed Loden Fix a segfault in TextLog_Print() by using %d for classification ID, …
…as it's a 'uint32_t'.
d21c7ee
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  src/log_text.c
2  src/log_text.c
@@ -92,7 +92,7 @@ void LogPriorityData(TextLog* log, uint32_t classification_id, uint32_t priority
92 92 else
93 93 {
94 94 TextLog_Print(
95   - log, "[Classification ID: %s] [Priority ID: %d] ",
  95 + log, "[Classification ID: %d] [Priority ID: %d] ",
96 96 classification_id, priority_id
97 97 );
98 98 }

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.