• Max Kellermann's avatar
    protocol/ArgParser: fix integer overflow in parse_range() · 421c4ae9
    Max Kellermann authored
    Casting std::numeric_limits<unsigned>::max() to "long" leads to an
    overflow if sizeof(unsigned)==sizeof(long), and the result will be -1.
    
    This happens on some 32 bit architectures, for example ARM and WIN32.
    
    Workaround: use std::numeric_limits<int>::max(), which is the largest
    signed integer.  Since sizeof(long)>=sizeof(int), this will never
    overflow.
    
    Fixes Mantis ticket 0004080.
    421c4ae9
Name
Last commit
Last update
doc Loading commit data...
m4 Loading commit data...
scripts Loading commit data...
src Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
INSTALL Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README Loading commit data...
UPGRADING Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
mpd.service.in Loading commit data...
valgrind.suppressions Loading commit data...