SQLite

Check-in [cad9faf3ad]
Login

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

Overview
Comment:Fix stack buffer overrun problem in the test harness. (CVS 3832)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: cad9faf3ad99b68be4618dff4b3497b15b9e6d9d
User & Date: drh 2007-04-09 20:30:11.000
Context
2007-04-09
20:45
Fix crash in delete when existing row has null fields. Previous code assumed that the row had values in all columns, sigh. Fixes bug http://www.sqlite.org/cvstrac/tktview?tn=2289 . (CVS 3833) (check-in: 81be7290a4 user: shess tags: trunk)
20:30
Fix stack buffer overrun problem in the test harness. (CVS 3832) (check-in: cad9faf3ad user: drh tags: trunk)
13:49
Version 3.3.15 (CVS 3831) (check-in: ba5f4a55fa user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/test_hexio.c.
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
** implements TCL commands for reading and writing the binary
** database files and displaying the content of those files as
** hexadecimal.  We could, in theory, use the built-in "binary"
** command of TCL to do a lot of this, but there are some issues
** with historical versions of the "binary" command.  So it seems
** easier and safer to build our own mechanism.
**
** $Id: test_hexio.c,v 1.1 2007/04/06 15:02:14 drh Exp $
*/
#include "tcl.h"
#include <stdlib.h>
#include <string.h>
#include <assert.h>

/*







|







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
** implements TCL commands for reading and writing the binary
** database files and displaying the content of those files as
** hexadecimal.  We could, in theory, use the built-in "binary"
** command of TCL to do a lot of this, but there are some issues
** with historical versions of the "binary" command.  So it seems
** easier and safer to build our own mechanism.
**
** $Id: test_hexio.c,v 1.2 2007/04/09 20:30:11 drh Exp $
*/
#include "tcl.h"
#include <stdlib.h>
#include <string.h>
#include <assert.h>

/*
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
    return TCL_ERROR;
  }
  nOut = hexToBin(zIn, nIn, aOut);
  if( nOut>=4 ){
    memcpy(aNum, aOut, 4);
  }else{
    memset(aNum, 0, sizeof(aNum));
    memcpy(&aNum[4-nOut], aOut, 4-nOut);
  }
  free(aOut);
  val = (aNum[0]<<24) | (aNum[1]<<16) | (aNum[2]<<8) | aNum[3];
  Tcl_SetObjResult(interp, Tcl_NewIntObj(val));
  return TCL_OK;
}








|







219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
    return TCL_ERROR;
  }
  nOut = hexToBin(zIn, nIn, aOut);
  if( nOut>=4 ){
    memcpy(aNum, aOut, 4);
  }else{
    memset(aNum, 0, sizeof(aNum));
    memcpy(&aNum[4-nOut], aOut, nOut);
  }
  free(aOut);
  val = (aNum[0]<<24) | (aNum[1]<<16) | (aNum[2]<<8) | aNum[3];
  Tcl_SetObjResult(interp, Tcl_NewIntObj(val));
  return TCL_OK;
}