Menu

#319 Fix overflows from multiplying time_t by "Micro"

Unstable_(example)
closed-fixed
nobody
None
5
2015-12-31
2015-12-31
No

Type of "Micro" inside enum cannot be forced and in fact is just int. In the number of places it's the multiplier of time_t or long and this leads to overflow and negative timeouts being passed to pthread_cond_timedwait().

1 Attachments

Discussion

  • Robert Jongbloed

    • status: open --> closed-fixed
     
  • Robert Jongbloed

    Micro can be made int64_t, which is what I have done. Let me know of this works for you.

     
    • Alexander Sverdlin

      Hello Robert,
      I believe, it will work. I was just confused by the fact, that Micro usage was intermixed all over the code with bare "1000000" immediates, so I've decided to remove Micro completely. But I don't have strong opinion on that... Thanks for looking into this! Happy New Year!

       

      Last edit: Alexander Sverdlin 2015-12-31
    • Alexander Sverdlin

      Robert, could you also please check the modifications of plugins/sound_shm/shmif.cpp and src/ptclib/guid.cxx from this patch, they are unrelated to "Micro", but fix the unit conversion errors.

       
  • Robert Jongbloed

    Done.

     

Log in to post a comment.