20
0

Update workbook.go

fix bug:use invalid size to alloc memory when  read big document
This commit is contained in:
hao 2016-06-29 14:52:59 +08:00 committed by GitHub
parent 991920a697
commit 898223162e

View File

@ -204,11 +204,12 @@ func (w *WorkBook) get_string(buf io.ReadSeeker, size uint16) (res string, err e
} }
err = binary.Read(buf, binary.LittleEndian, bts) err = binary.Read(buf, binary.LittleEndian, bts)
} }
if flag&0x4 != 0 {
var bts []byte //if flag&0x4 != 0 {
bts = make([]byte, phonetic_size) // var bts []byte
err = binary.Read(buf, binary.LittleEndian, bts) // bts = make([]byte, phonetic_size)
} // err = binary.Read(buf, binary.LittleEndian, bts)
//}
} }
return return
} }