Fossil

Check-in [26011322cd]
Login

Check-in [26011322cd]

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

Overview
Comment:Fix a null-pointer reference and segfault in /file if the filename= query parameter is used with ci= and without name=.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 26011322cd34934e552efbb264f395dc3f8ff2e481f0f2d38e7f8aa23292dfea
User & Date: drh 2020-05-10 15:29:00.502
Context
2020-05-11
18:12
Continuing UX improvements on the /file, /artifact, and /whatis pages. More needs to be done. ... (check-in: 1b5d0b0e18 user: drh tags: trunk)
14:09
Add setting that will suppress the new fork warning with every commit. ... (check-in: 57b8d6deac user: andybradford tags: fork-warn-setting)
04:17
Merge in trunk. ... (check-in: 09239396ae user: ashepilko tags: revert-dir)
2020-05-10
15:29
Fix a null-pointer reference and segfault in /file if the filename= query parameter is used with ci= and without name=. ... (check-in: 26011322cd user: drh tags: trunk)
15:06
Include the login name as part of the ETag hash for ETAG_QUERY. That way, the hash will change if the user logs in or logs out, and the page will be recomputed. ... (check-in: 18aec6b9a8 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/info.c.
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
**
**   ln              - show line numbers
**   ln=N            - highlight line number N
**   ln=M-N          - highlight lines M through N inclusive
**   ln=M-N+Y-Z      - highlight lines M through N and Y through Z (inclusive)
**   verbose         - show more detail in the description
**   download        - redirect to the download (artifact page only)
**   name=SHA1HASH   - Provide the SHA1HASH as a query parameter
**   filename=NAME   - Show information for content file NAME
**   fn=NAME         - "fn" is shorthand for "filename"
**   ci=VERSION      - The specific check-in to use for "filename=".
**
** The /artifact page show the complete content of a file
** identified by HASH as preformatted text.  The
** /whatis page shows only a description of the file.  The /file
** page shows the most recent version of the file or directory
** called NAME, or a list of the top-level directory if NAME is







|
|
|







2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
**
**   ln              - show line numbers
**   ln=N            - highlight line number N
**   ln=M-N          - highlight lines M through N inclusive
**   ln=M-N+Y-Z      - highlight lines M through N and Y through Z (inclusive)
**   verbose         - show more detail in the description
**   download        - redirect to the download (artifact page only)
**   name=NAME       - Provide filename or hash as a query parameter
**   filename=NAME   - alternative spelling for "name="
**   fn=NAME         - alternative spelling for "name="
**   ci=VERSION      - The specific check-in to use for "filename=".
**
** The /artifact page show the complete content of a file
** identified by HASH as preformatted text.  The
** /whatis page shows only a description of the file.  The /file
** page shows the most recent version of the file or directory
** called NAME, or a list of the top-level directory if NAME is
2131
2132
2133
2134
2135
2136
2137




2138
2139
2140
2141
2142
2143
2144
2145
2146
  char *zCIUuid = 0;
  int isSymbolicCI = 0;  /* ci= exists and is a symbolic name, not a hash */
  char *zHeader = 0;

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  url_initialize(&url, g.zPath);




  if( zCI && strlen(zCI)==0 ){ zCI = 0; }
  if( zCI ){
    blob_zero(&dirname);
    hyperlinked_path(zName, &dirname, zCI, "dir", "");
    blob_reset(&dirname);

    if( name_to_uuid2(zCI, "ci", &zCIUuid) ){
      isSymbolicCI = (sqlite3_strnicmp(zCIUuid, zCI, strlen(zCI)) != 0);
    }







>
>
>
>

|







2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
  char *zCIUuid = 0;
  int isSymbolicCI = 0;  /* ci= exists and is a symbolic name, not a hash */
  char *zHeader = 0;

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  url_initialize(&url, g.zPath);
  if( zName==0 ){
    zName = P("filename");
    if( zName==0 ) zName = P("fn");
  }
  if( zCI && strlen(zCI)==0 ){ zCI = 0; }
  if( zCI && zName ){
    blob_zero(&dirname);
    hyperlinked_path(zName, &dirname, zCI, "dir", "");
    blob_reset(&dirname);

    if( name_to_uuid2(zCI, "ci", &zCIUuid) ){
      isSymbolicCI = (sqlite3_strnicmp(zCIUuid, zCI, strlen(zCI)) != 0);
    }