* [PATCH 3] Fix core dump on huge switch
@ 2007-02-10 0:16 Christopher Li
2007-02-26 19:57 ` Josh Triplett
0 siblings, 1 reply; 2+ messages in thread
From: Christopher Li @ 2007-02-10 0:16 UTC (permalink / raw)
To: linux-sparse; +Cc: Josh Triplett
Bump up the size of the instruction buffer. vt_ioctl.c has
a huge switch statement causing sparse over flow the instruction
buffer.
Signed-Off-By: Christopher Li <sparse@chrisli.org>
Index: sparse/linearize.c
===================================================================
--- sparse.orig/linearize.c 2007-01-30 20:07:40.000000000 -0800
+++ sparse/linearize.c 2007-01-30 20:48:16.000000000 -0800
@@ -272,7 +272,7 @@ static char *show_asm(char *buf, struct
const char *show_instruction(struct instruction *insn)
{
int opcode = insn->opcode;
- static char buffer[1024];
+ static char buffer[4096];
char *buf;
buf = buffer;
@@ -457,6 +457,9 @@ const char *show_instruction(struct inst
default:
break;
}
+
+ if (buf >= buffer + sizeof buffer)
+ die("instruction buffer overflowed %d\n", buf - buffer);
do { --buf; } while (*buf == ' ');
*++buf = 0;
return buffer;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-02-26 19:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-10 0:16 [PATCH 3] Fix core dump on huge switch Christopher Li
2007-02-26 19:57 ` Josh Triplett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).