Fossil

Check-in [460b93b5]
Login

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

Overview
Comment:Use sqlite3_snprintf instead because it guarantees that the buffer will be zero-terminated and to avoid warnings on OpenBSD.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 460b93b53e5f0c385382ca92587319008e6f10bf
User & Date: andybradford 2016-06-09 02:22:52
Context
2016-06-09
15:26
Add mimetypes for bz2 and bzip. check-in: c7e9625d user: drh tags: trunk
02:22
Use sqlite3_snprintf instead because it guarantees that the buffer will be zero-terminated and to avoid warnings on OpenBSD. check-in: 460b93b5 user: andybradford tags: trunk
2016-06-07
15:27
If the FOSSIL_PWREADER environment variable is set to the name of a program, then use that program to prompt and read passwords and passphrases from the user when required, in place of the getpass() library routine. check-in: 55f3f3d4 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/export.c.

142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
...
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
  char sid[13];
  char *zUuid = rid_to_uuid(rid);
  if(!zUuid){
    fossil_trace("Undefined rid=%d\n", rid);
    return -1;
  }
  mark->rid = rid;
  sprintf(sid, ":%d", COMMITMARK(rid));
  mark->name = fossil_strdup(sid);
  strcpy(mark->uuid, zUuid);
  free(zUuid);
  insert_commit_xref(mark->rid, mark->name, mark->uuid);
  return 0;
}

/*
** mark_name_from_rid()
................................................................................

  cur_tok = strtok(NULL, "\n");
  if(!cur_tok||strlen(cur_tok)!=40){
    free(mark->name);
    fossil_trace("Invalid SHA-1 in marks file: %s\n", cur_tok);
    return -1;
  }else{
    strcpy(mark->uuid, cur_tok);
  }

  /* make sure that rid corresponds to UUID */
  if(fast_uuid_to_rid(mark->uuid)!=mark->rid){
    free(mark->name);
    fossil_trace("Non-existent SHA-1 in marks file: %s\n", mark->uuid);
    return -1;







|

|







 







|







142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
...
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
  char sid[13];
  char *zUuid = rid_to_uuid(rid);
  if(!zUuid){
    fossil_trace("Undefined rid=%d\n", rid);
    return -1;
  }
  mark->rid = rid;
  sqlite3_snprintf(sizeof(sid), sid, ":%d", COMMITMARK(rid));
  mark->name = fossil_strdup(sid);
  sqlite3_snprintf(sizeof(mark->uuid), mark->uuid, "%s", zUuid);
  free(zUuid);
  insert_commit_xref(mark->rid, mark->name, mark->uuid);
  return 0;
}

/*
** mark_name_from_rid()
................................................................................

  cur_tok = strtok(NULL, "\n");
  if(!cur_tok||strlen(cur_tok)!=40){
    free(mark->name);
    fossil_trace("Invalid SHA-1 in marks file: %s\n", cur_tok);
    return -1;
  }else{
    sqlite3_snprintf(sizeof(mark->uuid), mark->uuid, "%s", cur_tok);
  }

  /* make sure that rid corresponds to UUID */
  if(fast_uuid_to_rid(mark->uuid)!=mark->rid){
    free(mark->name);
    fossil_trace("Non-existent SHA-1 in marks file: %s\n", mark->uuid);
    return -1;