Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

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 Feb 7, 2013

Conversation

reedloden
Copy link

No description provided.

@reedloden
Copy link
Author

(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.

@binf
Copy link
Collaborator

binf commented Feb 7, 2013

Thanks for spotting this, im sure finsy will merge it when he has time.

On Wed, Feb 6, 2013 at 4:50 PM, Reed Loden notifications@github.com wrote:

(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.


Reply to this email directly or view it on GitHubhttps://github.com//pull/68#issuecomment-13207287.

firnsy pushed a commit that referenced this pull request Feb 7, 2013
Fix a segfault in TextLog_Print() by using %d for classification ID, as it's a 'uint32_t'.
@firnsy firnsy merged commit dfc81fa into firnsy:master Feb 7, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants