dtlogin: Avoid putenv to fix issue with passing stack address
putenv doesn't copy the data, so the stack address used here is plain wrong. It _probably_ doesn't matter all that much because it's immediately followed by execv(), but let's keep things clean.
This commit is contained in:
@@ -1490,10 +1490,8 @@ RespondLangCB( Widget w, XtPointer client, XtPointer call)
|
|||||||
/** but it does work ok. **/
|
/** but it does work ok. **/
|
||||||
/** notice the related code in chooser.c at the **/
|
/** notice the related code in chooser.c at the **/
|
||||||
/** beginning of main. **/
|
/** beginning of main. **/
|
||||||
char buff[128];
|
|
||||||
if (XmToggleButtonGadgetGetState(w)) {
|
if (XmToggleButtonGadgetGetState(w)) {
|
||||||
snprintf(buff, sizeof(buff), "LANG=%s", (char *) client);
|
setenv("LANG", client, 1);
|
||||||
putenv(buff);
|
|
||||||
execv(orig_argv[0], orig_argv);
|
execv(orig_argv[0], orig_argv);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user