mhonarc-dev

[patch #7682] Fix for a crash when minute or second is invalid

2011-12-01 06:00:09
URL:
  <http://savannah.nongnu.org/patch/?7682>

                 Summary: Fix for a crash when minute or second is invalid
                 Project: MHonArc
            Submitted by: rjsheehy
            Submitted on: Thu 01 Dec 2011 12:02:08 PM GMT
                Category: None
                Priority: 7 - High
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Added the two lines below:

        while ($min > 59 ) { $min-- } ;
        while ($sec > 59 ) { $sec-- } ;

This check was required because I would sometimes receive mail that had either
the second and/or the minute set to the value "60", which was rejected as
invalid by the timegm() function.

Prior to passing $min or $sec to the timegm() function, this code now ensures
that any value greater than 59 is decrimented to a legal value. 

This has fixed the crashes that were occuring on our production systems. 

Potentially $hr could also be checked for values greater than 23, but I did
not impliment or test this additional change.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 01 Dec 2011 12:02:08 PM GMT  Name: mhutil.pl  Size: 20kB   By:
rjsheehy

<http://savannah.nongnu.org/patch/download.php?file_id=24513>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?7682>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/

---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-DEV

<Prev in Thread] Current Thread [Next in Thread>
  • [patch #7682] Fix for a crash when minute or second is invalid, Robert Sheehy <=