Skip to content

Commit

Permalink
Merge pull request #7 from gahr/master
Browse files Browse the repository at this point in the history
Fix overflow of a nearby variable on the stack
  • Loading branch information
ray2501 committed May 10, 2016
2 parents e1cbd17 + 13f31f4 commit 83bfb22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions generic/tclmdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ static int LMDB_ENV(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
case DBENV_OPEN: {
const char *zArg;
char *path = NULL;
mdb_mode_t mode = 0664;
int mode = 0664;
int flags = 0;
int i = 0;

Expand All @@ -1373,7 +1373,7 @@ static int LMDB_ENV(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
if( strcmp(zArg, "-path")==0 ){
path = Tcl_GetStringFromObj(objv[i+1], 0);
} else if( strcmp(zArg, "-mode")==0 ){
if(Tcl_GetIntFromObj(interp, objv[i+1], (int *)&mode) != TCL_OK) {
if(Tcl_GetIntFromObj(interp, objv[i+1], &mode) != TCL_OK) {
return TCL_ERROR;
}
} else if( strcmp(zArg, "-fixedmap")==0 ){
Expand Down Expand Up @@ -1438,7 +1438,7 @@ static int LMDB_ENV(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
return TCL_ERROR;
}

result = mdb_env_open(env, path, flags, mode);
result = mdb_env_open(env, path, flags, (mdb_mode_t)mode);
if(result != 0) {
if( interp ) {
Tcl_Obj *resultObj = Tcl_GetObjResult( interp );
Expand Down

0 comments on commit 83bfb22

Please sign in to comment.