From: "Charles Coffing" <ccoffing@novell.com>
To: xen-devel@lists.sourceforge.net
Subject: [PATCH] sxpr dereferences freed memory
Date: Mon, 22 Nov 2004 13:26:37 -0700 [thread overview]
Message-ID: <s1a1e91b.080@sinclair.provo.novell.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 288 bytes --]
The attached patch applies to 2.0-testing.
If the xfrd daemon receives a message that is immediately followed by an
EOF, without first seeing whitespace (usually a newline), the sxpr
parser will dereference freed memory. The attached patch fixes the
dangling pointer.
Thanks,
Charles
[-- Attachment #2: sxpr_dangling.patch --]
[-- Type: application/octet-stream, Size: 669 bytes --]
===== tools/xfrd/sxpr_parser.c 1.1 vs edited =====
--- 1.1/tools/xfrd/sxpr_parser.c 2004-07-07 09:54:46 -06:00
+++ edited/tools/xfrd/sxpr_parser.c 2004-11-22 12:55:39 -07:00
@@ -242,6 +242,8 @@
int err = 0;
ParserState *s = p->state;
p->state = s->parent;
+ if (p->start_state == s)
+ p->start_state = NULL;
ParserState_free(s);
return err;
}
@@ -374,7 +376,7 @@
if(CONSP(p->val)){
v = p->val;
p->val = ONONE;
- } else if(CONSP(p->start_state->val)){
+ } else if(p->start_state && CONSP(p->start_state->val)){
v = p->start_state->val;
p->start_state->val = ONULL;
v = nrev(v);
reply other threads:[~2004-11-22 20:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s1a1e91b.080@sinclair.provo.novell.com \
--to=ccoffing@novell.com \
--cc=xen-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.