dnsmasq: fix heap overflow

Backport CVE-2017-14491.
(http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=0549c73b7ea6b22a3c49beb4d432f185a81efcbc)

Bug: 158221622
Test: 1. Manual testing - build dnsmasq with asan enabled and test the
         corresponding functionalities.
      2. Test tethering still worked fine
Change-Id: I90390535198fe0a7b8084879d39f813d8de51ab3
(cherry picked from commit b7ae3453bfcc139be75c8dec5cdb8a1453eb6e16)
(cherry picked from commit 2c415e570aed0b955698238a274a50f3ffa4892e)
4 files changed