Integer overflow on armhf, test error

Bug #1884152 reported by Andreas Hasenack
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
golang-github-miekg-dns (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

This test is failing on armhf:

```
=== RUN TestGenerateRangeGuard
    TestGenerateRangeGuard: generate_test.go:81: expected

        @ IN SOA ns.test. hostmaster.test. ( 1 8h 2h 7d 1d )
        $GENERATE 0-2 dhcp-${2147483647,4,d} A 10.0.0.$

        to fail, but got no error
--- FAIL: TestGenerateRangeGuard (0.01s)
```
I believe this was introduced in commit c0283a2028317d3fb6574f9a06e68443cf6b89cd which added this check:
```golang
                        if r.start+offset < 0 || r.end+offset > 1<<31-1 {
                                return 0, r.parseError("bad offset in $GENERATE", si+3+sep)
                        }
```

The test will reach (1<<31-1)+2, meaning `r.end+offset` on 32bits systems will become negative and thus not trigger the condition above.

Upstream bug report: https://github.com/miekg/dns/issues/1129

Shengjing Zhu (zhsj)
Changed in golang-github-miekg-dns (Ubuntu):
status: New → Incomplete
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.