Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix segfaults due to parameter size mismatch #48

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pTk/mTk/generic/tkCanvText.c
Original file line number Diff line number Diff line change
Expand Up @@ -1234,8 +1234,7 @@ GetTextIndex(interp, canvas, itemPtr, obj, indexPtr)
* index. */
{
TextItem *textPtr = (TextItem *) itemPtr;
size_t length;
int c;
int c, length;
TkCanvas *canvasPtr = (TkCanvas *) canvas;
Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr;
char *string;
Expand Down
10 changes: 4 additions & 6 deletions pTk/mTk/generic/tkFrame.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,7 @@ CreateFrame(clientData, interp, objc, objv, type, appName)
CONST char *className, *screenName, *colormapName, *arg;
Tcl_Obj *visualName;
Tcl_Obj *useOption;
int i, c, depth;
size_t length;
int i, c, depth, length;
unsigned int mask;
Colormap colormap;
Visual *visual;
Expand Down Expand Up @@ -523,7 +522,7 @@ CreateFrame(clientData, interp, objc, objv, type, appName)
visualName = NULL;
colormap = None;
for (i = 2; i < objc; i += 2) {
arg = Tcl_GetStringFromObj(objv[i], (int *) &length);
arg = Tcl_GetStringFromObj(objv[i], &length);
if (length < 2) {
continue;
}
Expand Down Expand Up @@ -749,8 +748,7 @@ FrameWidgetObjCmd(clientData, interp, objc, objv)
};
register Frame *framePtr = (Frame *) clientData;
int result = TCL_OK, index;
size_t length;
int c, i;
int c, i, length;
Tcl_Obj *objPtr;

if (objc < 2) {
Expand Down Expand Up @@ -798,7 +796,7 @@ FrameWidgetObjCmd(clientData, interp, objc, objv)
*/

for (i = 2; i < objc; i++) {
char *arg = Tcl_GetStringFromObj(objv[i], (int *) &length);
char *arg = Tcl_GetStringFromObj(objv[i], &length);
if (length < 2) {
continue;
}
Expand Down
11 changes: 5 additions & 6 deletions pTk/mTk/generic/tkImgPhoto.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,10 +676,9 @@ ImgPhotoCmd(clientData, interp, objc, objv)
XColor color;
Tk_PhotoImageFormat *imageFormat;
int imageWidth, imageHeight;
int matched;
int length, matched;
Tcl_Channel chan;
Tk_PhotoHandle srcHandle;
size_t length;
Tcl_Obj *obj;
int c;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Expand Down Expand Up @@ -723,7 +722,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
Tcl_WrongNumArgs(interp, 2, objv, "option");
return TCL_ERROR;
}
arg = Tcl_GetStringFromObj(objv[2], (int *) &length);
arg = Tcl_GetStringFromObj(objv[2], &length);
if (strncmp(arg,"-data", length) == 0) {
if (masterPtr->dataString) {
Tcl_SetObjResult(interp, masterPtr->dataString);
Expand Down Expand Up @@ -768,7 +767,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
return TCL_OK;
}
if (objc == 3) {
char *arg = Tcl_GetStringFromObj(objv[2], (int *) &length);
char *arg = Tcl_GetStringFromObj(objv[2], &length);
if (!strncmp(arg, "-data", length)) {
Tcl_Obj *subobj = Tcl_NewStringObj("-data {} {} {}", 14);
if (masterPtr->dataString) {
Expand Down Expand Up @@ -5753,8 +5752,8 @@ PhotoOptionFind(interp, obj)
Tcl_Interp *interp; /* Interpreter that is being deleted. */
Tcl_Obj *obj; /* Name of option to be found. */
{
size_t length;
char *name = Tcl_GetStringFromObj(obj, (int *) &length);
int length;
char *name = Tcl_GetStringFromObj(obj, &length);
OptionAssocData *list;
char *prevname = NULL;
Tcl_ObjCmdProc *proc = (Tcl_ObjCmdProc *) NULL;
Expand Down