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: [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: Mon, 2 Oct 2006 19:06:48 +0200

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

  • Follow-Ups:
    • Re: [Wireshark-dev] call to cf_read(&cfile) corrupts stack
      • From: LEGO
  • Prev by Date: [Wireshark-dev] Your message to Wireshark-users awaits moderator approval
  • Next by Date: Re: [Wireshark-dev] [Wireshark-commits] rev 19372: /trunk/ /trunk/: Makefile.nmake
  • Previous by thread: [Wireshark-dev] Your message to Wireshark-users awaits moderator approval
  • Next by thread: Re: [Wireshark-dev] call to cf_read(&cfile) corrupts stack
  • Index(es):
    • Date
    • Thread

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