History

fix data overflow with init_putv

The simplest code to reproduce this bug seems to be int a[][] = {{1,1,1,1,1,1,1}};

grischka committed 17 years ago

Commit 7c3f19c1 parent aa8d22e1 file · +4 −0Browse files

Unified · Split

tcc.c+4−0
@@ -8808,6 +8808,10 @@ static void init_putv(CType *type, Section *sec, unsigned long c, · 8807 unmodified lines
8808 /* XXX: generate error if incorrect relocation */8808 /* XXX: generate error if incorrect relocation */
8809 gen_assign_cast(&dtype);8809 gen_assign_cast(&dtype);
8810 bt = type->t & VT_BTYPE;8810 bt = type->t & VT_BTYPE;
8811 /* we'll write at most 12 bytes */
8812 if (c + 12 > sec->data_allocated) {
8813 section_realloc(sec, c + 12);
8814 }
8811 ptr = sec->data + c;8815 ptr = sec->data + c;
8812 /* XXX: make code faster ? */8816 /* XXX: make code faster ? */
8813 if (!(type->t & VT_BITFIELD)) {8817 if (!(type->t & VT_BITFIELD)) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t