Menu

strange code in the SDK

2014-08-21
2014-08-21
  • Vincent TORRI

    Vincent TORRI - 2014-08-21

    Hello

    in the SDK, file 7zIn.c, lines 1152-1153, I can see :

    if (nextHeaderOffset > nextHeaderOffset + nextHeaderSize ||
        nextHeaderOffset > nextHeaderOffset + nextHeaderSize + k7zStartHeaderSize)
    

    but all the variables are unsigned (that is, >= 0), so I think that this test is always false

    is it normal to have such test ?

    thank you

    Vincent Torri

     
  • Igor Pavlov

    Igor Pavlov - 2014-08-21

    I tried to prevent "add overflow" (over 0).

     

Log in to post a comment.