SQLite

Check-in [186d7ff1d9]
Login

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

Overview
Comment:Make sure the multiplexor shim uses a full pathname for temp file that it creates.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 186d7ff1d9804d508e472e4939608bf2be67bdc2
User & Date: drh 2011-05-18 03:02:10.059
Context
2011-05-18
17:15
Enable URI filenames in the command-line shell. Add a check to the beginning of the shell to make sure it is compiled with the same SQLite source and header. (check-in: de58cb2838 user: drh tags: trunk)
03:02
Make sure the multiplexor shim uses a full pathname for temp file that it creates. (check-in: 186d7ff1d9 user: drh tags: trunk)
02:41
Remove unreachable branches from the 8.3 filename logic. (check-in: 4f7e7b44f2 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/test_multiplex.c.
214
215
216
217
218
219
220


221
222
223
224
225
226
227
228



229
230
231
232
233
234
235
  int exists = 0;
  int rc = SQLITE_ERROR;

  /* Check that the output buffer is large enough for 
  ** pVfs->mxPathname characters.
  */
  if( pOrigVfs->mxPathname <= nBuf ){



    /* sqlite3_temp_directory should always be less than
    ** pVfs->mxPathname characters.
    */
    sqlite3_snprintf(pOrigVfs->mxPathname,
                     zBuf,
                     "%s/",
                     sqlite3_temp_directory ? sqlite3_temp_directory : ".");




    /* Check that the output buffer is large enough for the temporary file 
    ** name.
    */
    j = multiplexStrlen30(zBuf);
    if( (j + 8 + 1 + 3 + 1) <= nBuf ){
      /* Make 3 attempts to generate a unique name. */







>
>





|


>
>
>







214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
  int exists = 0;
  int rc = SQLITE_ERROR;

  /* Check that the output buffer is large enough for 
  ** pVfs->mxPathname characters.
  */
  if( pOrigVfs->mxPathname <= nBuf ){
    char *zTmp = sqlite3_malloc(pOrigVfs->mxPathname);
    if( zTmp==0 ) return SQLITE_NOMEM;

    /* sqlite3_temp_directory should always be less than
    ** pVfs->mxPathname characters.
    */
    sqlite3_snprintf(pOrigVfs->mxPathname,
                     zTmp,
                     "%s/",
                     sqlite3_temp_directory ? sqlite3_temp_directory : ".");
    rc = pOrigVfs->xFullPathname(pOrigVfs, zTmp, nBuf, zBuf);
    sqlite3_free(zTmp);
    if( rc ) return rc;

    /* Check that the output buffer is large enough for the temporary file 
    ** name.
    */
    j = multiplexStrlen30(zBuf);
    if( (j + 8 + 1 + 3 + 1) <= nBuf ){
      /* Make 3 attempts to generate a unique name. */