Wireshark

  • Riverbed Technology
  • WinPcap
the world's foremost network protocol analyzer
  • Wireshark
    • About
    • Download
    • Blog
  • Get Help
    • Ask a Question
    • FAQs
    • Documentation
    • Mailing Lists
    • Online Tools
    • Wiki
    • Bug Tracker
  • Develop
    • Get Involved
    • Developer's Guide
    • Browse the Code
    • Latest Builds

Wireshark-dev: Re: [Wireshark-dev] call to cf_read(&cfile) corrupts stack

Date Index Thread Index Other Months All Mailing Lists
Date Prev Date Next Thread Prev Thread Next


From: LEGO <luis.ontanon@xxxxxxxxx>
Date: Wed, 4 Oct 2006 19:48:01 +0100

Nope!
I was running it from a TextWindow... where the button callback data
was ep_allocated...
ep_allocated memory got reused after cf_read() and so it crashed...


On 10/2/06, LEGO <luis.ontanon@xxxxxxxxx> wrote:
Hi folks,

while writing an open_capture_file() function for lua I came up with
an odd situation.

When executing the following code more than once, during the cf_read
call the stack gets overwritten.

        if (cf_open(&cfile, fname, FALSE, &err) != CF_OK) {
                return FALSE;
        }
        cfile.rfcode = rfcode;

        switch (cf_read(&cfile)) {
                case CF_READ_OK:
                case CF_READ_ERROR:
                        break;
                default:
                        return FALSE;
        }

overwriting happens when calling wtap_read() from file.c:405

I tried to understand why this happens but nothing appears to me to be
the cause.

Is there something I should do before calling cf_open() to avoid this happening.

Thanks,
Luis


--
This information is top security. When you have read it, destroy yourself.
-- Marshall McLuhan



--
This information is top security. When you have read it, destroy yourself.
-- Marshall McLuhan

  • References:
    • [Wireshark-dev] call to cf_read(&cfile) corrupts stack
      • From: LEGO
  • Prev by Date: Re: [Wireshark-dev] Patch for gtk/capture_dlg.c (Bug 771)
  • Next by Date: Re: [Wireshark-dev] RTP-MIDI
  • Previous by thread: [Wireshark-dev] call to cf_read(&cfile) corrupts stack
  • Next by thread: [Wireshark-dev] [Patch] update to packet-newmail.c
  • Index(es):
    • Date
    • Thread

Wireshark and the "fin" logo are registered trademarks of the Wireshark Foundation