qemu_strtod
Abrasive Grit <[email protected]> Wed, 10 May 2023 16:00:50 +0530
| Newsgroups | gmane.comp.gnu.aspell.devel |
|---|---|
| Message-ID | <CAFbeDAt8MfvjNno+uCY=FLLdQD=9BPzPNALFKfS=+E0qNjk9Wg@mail.gmail.com> |
--00000000000034ffd505fb545e74 Content-Type: text/plain; charset="UTF-8" Auditing callers, we have no external callers of qemu_strtod, and among the callers of qemu_strtod_finite: - qapi/qobject-input-visitor.c:qobject_input_type_number_keyval() and qapi/string-input-visitor.c:parse_type_number() which reject all errors (does not matter what we store) - utils/cutils.c:do_strtosz() incorrectly assumes that *endptr points to '.' on all failures (that is, it is not distinguishing between EINVAL and ERANGE; and therefore still does the WRONG THING for "9.9e999". The change here does not fix that (a later patch will tackle this more systematically), but at least the value of endptr is less likely to be out of bounds on overflow - our testsuite, which we can update to match what we document Thanks and Regards Deepanshu Garg https://www.abrasivegrit.in/product/silicon-carbide --00000000000034ffd505fb545e74 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><pre style=3D"color:rgb(0,0,0)">Auditing callers, we have = no external callers of qemu_strtod, and among the callers of qemu_strtod_finite: - qapi/qobject-input-visitor.c:qobject_input_type_number_keyval() and qapi/string-input-visitor.c:parse_type_number() which reject all errors (does not matter what we store) - utils/cutils.c:do_strtosz() incorrectly assumes that *endptr points to '.' on all failures (that is, it is not distinguishing between EINVAL and ERANGE; and therefore still does the WRONG THING for "9.9e999". The change here does not fix that (a later patch wi= ll tackle this more systematically), but at least the value of endptr is less likely to be out of bounds on overflow - our testsuite, which we can update to match what we document</pre><pre st= yle=3D"color:rgb(0,0,0)"><br></pre><pre style=3D"color:rgb(0,0,0)">Thanks a= nd Regards </pre><pre style=3D"color:rgb(0,0,0)">Deepanshu Garg </pre><pre = style=3D"color:rgb(0,0,0)"><a href=3D"https://www.abrasivegrit.in/product/s= ilicon-carbide">https://www.abrasivegrit.in/product/silicon-carbide</a></pr= e></div> --00000000000034ffd505fb545e74--