mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Added checks for nil pointers in Marshal functions
This commit is contained in:
parent
2cd6059e51
commit
ca32505902
1 changed files with 8 additions and 0 deletions
|
|
@ -100,6 +100,10 @@ func (e *G1) Marshal() []byte {
|
|||
// Each value is a 256-bit number.
|
||||
const numBytes = 256 / 8
|
||||
|
||||
if e.p == nil {
|
||||
e.p = &curvePoint{}
|
||||
}
|
||||
|
||||
e.p.MakeAffine()
|
||||
ret := make([]byte, numBytes*2)
|
||||
if e.p.IsInfinity() {
|
||||
|
|
@ -382,6 +386,10 @@ func (e *GT) Marshal() []byte {
|
|||
// Each value is a 256-bit number.
|
||||
const numBytes = 256 / 8
|
||||
|
||||
if e.p == nil {
|
||||
e.p = &gfP12{}
|
||||
}
|
||||
|
||||
ret := make([]byte, numBytes*12)
|
||||
temp := &gfP{}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue