BIND 10 #2558: fromJSON is not able to handle full uint32 range

BIND 10 Development do-not-reply at isc.org
Fri Dec 14 10:03:16 UTC 2012


#2558: fromJSON is not able to handle full uint32 range
-------------------------------------+-------------------------------------
                   Reporter:  tomek  |                 Owner:
                       Type:         |                Status:  new
  defect                             |             Milestone:  New Tasks
                   Priority:         |              Keywords:
  medium                             |             Sensitive:  0
                  Component:         |           Sub-Project:  Core
  configuration                      |  Estimated Difficulty:  0
               CVSS Scoring:         |           Total Hours:  0
            Defect Severity:  N/A    |
Feature Depending on Ticket:         |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
 I've got a problem with failing Dhcp4ParserTest.Uint32Parser and need some
 help. DHCP uses various parameters that are unsigned 32 bits. The test
 tries to verify if certain boundary values (-1, 0, UINT_MAX, UINT_MAX + 1)
 are parsed or rejected as expected. My test calls fromJSON(), which in
 turn calls from_stringstream_number() method in src/lib/cc/data.cc.

 That function is not able to handle values greater than INT_MAX on 32 bit
 systems. Note that it does so on 64 bit systems.

 Muks suggested:
 [10:55:00] <muks> so i suppose we can use strtoll() in there
 [10:55:10] <muks> so it works on ILP32 platforms
 [10:55:45] <muks> and perhaps have an Element::create() for it..
 [10:56:25] <muks> hmm
 [10:56:44] <muks> maybe it's better to change IntElement to hold a long
 long
 [10:57:59] <muks> tomek: can you file a bug for it?
 [10:58:24] <muks> it's larger than a simple patch and would need to be
 reviewed
 [10:58:37] <tomek> Sure.
 [10:58:46] <muks> we can update IntElement to hold a int64_t i guess
 [10:59:23] <muks> and use strtoll() in from_stringstream_number()

 To verify that it indeed works as expected, it seems useful to enable
 Dhcp4ParserTest.Uint32Parser in
 src/bin/dhcp4/tests/config_parser_unittest.cc and confirm that it indeed
 works on 32 bit systems.

-- 
Ticket URL: <http://bind10.isc.org/ticket/2558>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list