Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001318TestLinkDatabase Generalpublic2008-01-23 00:252009-02-06 06:49
Reportertuergeist 
Assigned Tofman 
PrioritynormalSeveritytrivialReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Fixed in Version1.8 RC 4 
Summary0001318: Reading possibly nonexistend array key
Descriptionin lib/functions/database.class.php - fetchFirstRowSingleColumn($query,$column) - line 399
    
if ($row)
    $value = $row[$column];
        
should be substituted by

if ($row && array_key_exists($column, $row))
{
    $value = $row[$column];
}
Additional InformationVersion: SNAPSHOT-08-01-22
TagsNo tags attached.
Database (MySQL,Postgres,etc)
Browser
PHP Version
TestCaseID
QA Team - Task Workflow Status
Attached Files

- Relationships

-  Notes
(0003012)
fman (administrator)
2008-01-23 01:48

Hummm, more or less, if you request a non existent column IMHO is better crash
(0003019)
tuergeist
2008-01-23 03:55

there is no crash... If errorlevel "Notice" is enabled, you'll be informed that you make an uninitialized read or key not existend

result will be >>null<<

array key checking does not change the result at all, it prevents unpredictable results. another solution is to handle the case "array key not exists" with an exception or sth else

- Issue History
Date Modified Username Field Change
2008-01-23 00:25 tuergeist New Issue
2008-01-23 01:48 fman Note Added: 0003012
2008-01-23 03:55 tuergeist Note Added: 0003019
2008-01-25 05:26 fman Status new => assigned
2008-01-25 05:26 fman Assigned To => fman
2009-02-04 16:18 fman Status assigned => resolved
2009-02-04 16:18 fman Fixed in Version => next DEV - 1.8 RC 4
2009-02-04 16:18 fman Resolution open => fixed
2009-02-06 06:49 mhavlat Status resolved => closed



Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker