Fossil

Check-in [01a769a9]
Login

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

Overview
Comment:Fix double-free of zCopy in date_to_uuid(). Ticket [dc2b2503031]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:01a769a9fa265971f5a9c09cb16a1211bb3dee33
User & Date: drh 2010-02-06 12:14:29
References
2010-02-06
12:16 Fixed ticket [dc2b2503]: Maybe error in last ci plus 2 other changes artifact: 9e0ff8e0 user: drh
Context
2010-02-06
17:25
Windows only: remove duplicate code from sqlite3.c in db.c check-in: 2f58d48c user: ron tags: trunk
12:14
Fix double-free of zCopy in date_to_uuid(). Ticket [dc2b2503031] check-in: 01a769a9 user: drh tags: trunk
2010-02-05
21:09
Accept date/time strings as a valid tag. They resolve to the most recent check-in prior to the given date/time. check-in: 93827b84 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/name.c.

168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
  if( n>4 && sqlite3_strnicmp(&zDate[n-3], "utc", 3)==0 ){
    zCopy = mprintf("%s", zDate);
    zCopy[n-3] = 0;
    zDate = zCopy;
    n -= 3;
    useUtc = 1;
  }
  free(zCopy);
  zUuid = db_text(0,
    "SELECT (SELECT uuid FROM blob WHERE rid=event.objid)"
    "  FROM event"
    " WHERE mtime<=julianday(%Q %s) AND type='ci'"
    " ORDER BY mtime DESC LIMIT 1",
    zDate, useUtc ? "" : ",'utc'"
  );







<







168
169
170
171
172
173
174

175
176
177
178
179
180
181
  if( n>4 && sqlite3_strnicmp(&zDate[n-3], "utc", 3)==0 ){
    zCopy = mprintf("%s", zDate);
    zCopy[n-3] = 0;
    zDate = zCopy;
    n -= 3;
    useUtc = 1;
  }

  zUuid = db_text(0,
    "SELECT (SELECT uuid FROM blob WHERE rid=event.objid)"
    "  FROM event"
    " WHERE mtime<=julianday(%Q %s) AND type='ci'"
    " ORDER BY mtime DESC LIMIT 1",
    zDate, useUtc ? "" : ",'utc'"
  );