Package: chromium
Version: 0.9.12-5
Tags: patch
Severity: minor

I have several different machines all of which share the same home
directories. When I start chromium on a 64bit platform it segfaults in
HiScore::print(int skill). The reason this happens is because the
highscores file was first written by a 32bit platform. The precise cause
of the segfault is the failure of the call to localtime() on line 308,
which returns NULL (and sets errno). Currently chromium does not check
the return value of this call, and continues regardless, which clearly
is not appropriate behaviour for an application. I've attached a very
simple fix to this email, but it won't make the highscores portable,
just prevents it from crashing if localtime() fails.

Alan
--- src/HiScore.cpp.orig        2005-03-17 23:41:17.798546920 +0000
+++ src/HiScore.cpp     2005-03-17 23:41:37.522548416 +0000
@@ -306,6 +306,8 @@
        for(int j = 0; j < HI_SCORE_HIST; j++)
        {
                tmptr = localtime(&hiScoreDate[skill][j]);
+               if (!tmptr)
+                       break;
                fprintf(stderr, "%02d/%02d/%04d %16s %d\n", 1+tmptr->tm_mon, 
tmptr->tm_mday, 1900+tmptr->tm_year,
                                hiScoreName[skill][j], 
(int)(hiScore[skill][j]));
        }

Attachment: signature.asc
Description: OpenPGP digital signature



Reply via email to