Fossil

Check-in [9d3fe01a]
Login

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

Overview
Comment:Fix an invalid free() call that could occur when the "info" command was used with an invalid artifact ID. Ticket [aa8ba0fffa].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9d3fe01ae333adcea94acb637f8a8a5f40acb280
User & Date: drh 2009-12-27 18:19:38
References
2009-12-27
18:20 Fixed ticket [aa8ba0ff]: Crash on "fossil info 1234" plus 2 other changes artifact: 3eba164d user: drh
Context
2009-12-29
00:11
Only record the first 16 bits of the 32-bit IP address as part of the anonymous login cookie. check-in: 86cbb69a user: drh tags: trunk
2009-12-27
18:19
Fix an invalid free() call that could occur when the "info" command was used with an invalid artifact ID. Ticket [aa8ba0fffa]. check-in: 9d3fe01a user: drh tags: trunk
2009-12-26
15:30
removed an extraneous pair of row/cell closing tags. Fixed TH tags which were closed with TD instead of TH. check-in: 06b964a0 user: stephan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/info.c.

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
  Stmt q;
  char *zComment = 0;
  char *zTags;
  char *zDate;
  char *zUuid;
  zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
  if( zUuid ){
    zDate = db_text("", 
      "SELECT datetime(mtime) || ' UTC' FROM event WHERE objid=%d",
      rid
    );
         /* 01234567890123 */
    printf("%-13s %s %s\n", zUuidName, zUuid, zDate);
    free(zUuid);
    free(zDate);
  }
  db_prepare(&q, "SELECT uuid, pid FROM plink JOIN blob ON pid=rid "
                 " WHERE cid=%d", rid);
  while( db_step(&q)==SQLITE_ROW ){
    const char *zUuid = db_column_text(&q, 0);







|




|







60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
  Stmt q;
  char *zComment = 0;
  char *zTags;
  char *zDate;
  char *zUuid;
  zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
  if( zUuid ){
    zDate = db_text(0, 
      "SELECT datetime(mtime) || ' UTC' FROM event WHERE objid=%d",
      rid
    );
         /* 01234567890123 */
    printf("%-13s %s %s\n", zUuidName, zUuid, zDate ? zDate : "");
    free(zUuid);
    free(zDate);
  }
  db_prepare(&q, "SELECT uuid, pid FROM plink JOIN blob ON pid=rid "
                 " WHERE cid=%d", rid);
  while( db_step(&q)==SQLITE_ROW ){
    const char *zUuid = db_column_text(&q, 0);