[Tickets #5980] Re: Import of events via sync fails caused by empty uid

bugs at bugs.horde.org bugs at bugs.horde.org
Fri Dec 14 21:57:19 UTC 2007


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=5980
-----------------------------------------------------------------------
 Ticket             | 5980
 Updated By         | xk3 at mompl.org
 Summary            | Import of events via sync fails caused by empty uid
 Queue              | Kronolith
 Version            | 2.2-RC1
 Type               | Bug
 State              | Feedback
 Priority           | 2. Medium
 Owners             | 
-----------------------------------------------------------------------


xk3 at mompl.org (2007-12-14 16:57) wrote:

got it! Was hidden in logMessage that I did not suspect till now.

in kronolith/lib/Driver/sql.php
function &getByUID
   $values = array($uid);
   /* Log the query at a DEBUG log level. */
   Horde::logMessage(sprintf('Kronolith_Driver_sql::getByUID(): user =
"%s"; query = "%s"; values = "%s"',
Auth::getAuth(), $query, implode(',', $values)),

The sprintf causes a segfault, if $uid === null (which it is in my case).
Skipping the logMessage the event is correctly imported. 

Test script:

<?php                                                                     

$uid = null;                                                           
echo "XXX 0 \n"; 
$values = array($uid); 
echo "XXX 1 \n"; 
$tmp = sprintf('Kronolith_Driver_sql::getByUID(): user = "%s"; query =
"%s"; values = "%s"', 
               'myID', 'query', implode(',', $values)); 
echo "XXX 2 \n"; 
?>

gives: 
XXX 0 
XXX 1 
Segmentation fault


PHP Version 5.2.0-8+etch7 (debian)
eAccelerator switched off 



More information about the bugs mailing list