Re: File load magic misfeature and workaround

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 29, 1999 at 04:43:20PM +1100, David Hodson <hodsond@xxxxxxxxxxxxxx> wrote:
> the value to check is loaded into a (signed) int variable, and strtol()
> The easy workaround is to search for a four-byte string value instead.

It would occur to me that the real problem is strtol overflowing. Why does
strtol overflow at all? POSIX requires strtol to be able to convert _all_
long values.

Would specifying the right (signed) constant help?

If you think all this should be documented somewhere, then you are
definitely right ;)

-- 
      -----==-                                             |
      ----==-- _                                           |
      ---==---(_)__  __ ____  __       Marc Lehmann      +--
      --==---/ / _ \/ // /\ \/ /       pcg@xxxxxxxxxxxxx |e|
      -=====/_/_//_/\_,_/ /_/\_\       XX11-RIPE         --+
    The choice of a GNU generation                       |
                                                         |


[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux