Fossil

Check-in [8407bed7]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:If a badly malformed change artifact corrupts the "mtime" field of the event table, the date can end up being NULL for entries in the timeline. Make sure this does not cause a NULL-pointer deference.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:8407bed76df175504d38423af2f81d0239125ae1
User & Date: drh 2014-01-07 19:10:57
Context
2014-01-08
00:58
Remove no longer necessary cursor='pointer'. check-in: 927cacb3 user: joel tags: trunk
2014-01-07
19:10
If a badly malformed change artifact corrupts the "mtime" field of the event table, the date can end up being NULL for entries in the timeline. Make sure this does not cause a NULL-pointer deference. check-in: 8407bed7 user: drh tags: trunk
16:05
Use fossil_strnicmp() instead of memcmp() for date comparisons, to avoid NULL-pointer deferences if something is wrong with the database and a NULL date is returned from a query. check-in: 29b2eeba user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/timeline.c.

287
288
289
290
291
292
293

294
295
296
297
298
299
300
    int tagid = db_column_int(pQuery, 9);
    const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous";
    const char *zBr = 0;      /* Branch */
    int commentColumn = 3;    /* Column containing comment text */
    int modPending;           /* Pending moderation */
    char zTime[20];


    modPending =  moderation_pending(rid);
    if( tagid ){
      if( modPending ) tagid = -tagid;
      if( tagid==prevTagid ){
        if( tmFlags & TIMELINE_BRIEF ){
          suppressCnt++;
          continue;







>







287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
    int tagid = db_column_int(pQuery, 9);
    const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous";
    const char *zBr = 0;      /* Branch */
    int commentColumn = 3;    /* Column containing comment text */
    int modPending;           /* Pending moderation */
    char zTime[20];

    if( zDate==0 ) zDate = "YYYY-MM-DD HH:MM:SS";  /* Something wrong with the repo */
    modPending =  moderation_pending(rid);
    if( tagid ){
      if( modPending ) tagid = -tagid;
      if( tagid==prevTagid ){
        if( tmFlags & TIMELINE_BRIEF ){
          suppressCnt++;
          continue;