kgabis / parson

Lightweight JSON library written in C.
MIT License
1.34k stars 327 forks source link

fix Arithmetic overflow #204

Closed vaavva closed 1 year ago

vaavva commented 1 year ago

We're getting the following warning: Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).

This PR resolves the warning by making 0.7 a double instead of a float.

vaavva commented 1 year ago

@kgabis could you please take a look at this one-line change?

kgabis commented 1 year ago

I'm on holiday, I won't be able to merge it before Monday. In the meantime please increment patch version and change https://github.com/kgabis/parson/pull/204/files#r1184870569.

Since you work at Microsoft, could you contact me with someone responsible for open source? Few weeks ago I applied for Azure credits to test parson on windows and still didn't receive any reply. Also, Microsoft has been using parson for years now and I've provided continuous support for various PRs and bugfixes so I wanted to discuss Microsoft becoming a sponsor but I couldn't find a way to contact anyone about it.

vaavva commented 1 year ago

Unfortunately, I don't have any more information internally than you can find externally about open source contacts, sorry! I updated the patch version and made the change you suggested, thanks for taking a look at this!

vaavva commented 1 year ago

@kgabis Is there anything else I need to do for the patch version?

kgabis commented 1 year ago

Done :)