herumi / bls

288 stars 133 forks source link

fix more nil pointer issue #29

Closed LeoHChen closed 5 years ago

LeoHChen commented 5 years ago
herumi commented 5 years ago

Thank you for your patch. I have merged it. But I have a question. Should the caller be careful that the variable is not nil?

LeoHChen commented 5 years ago

Thank you for your patch. I have merged it. But I have a question. Should the caller be careful that the variable is not nil?

Yes, caller should be careful. but in the go program, the public key could be nil and it is valid and it won't crash. However, when it calls to the C function, it will crash the program with a nil pointer issue. It's always better to be protective in the underlying library perspective, IMHO.

herumi commented 5 years ago

Thank you for the option. I see.