Jim Tcl
Check-in [cbda0f1515]
Not logged in

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

Overview
Comment:exec: Validate that a command is given

Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>

Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:cbda0f151581e013fc43320544f0179b2cefd5eb
User & Date: steveb@workware.net.au 2017-05-12 03:01:48
Context
2017-05-12
03:01
scan: error on missing conversion char

Don't read invalid memory

Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 9fd054339d user: steveb@workware.net.au tags: trunk

03:01
exec: Validate that a command is given

Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: cbda0f1515 user: steveb@workware.net.au tags: trunk

03:01
jim: Fix ref count problem with interpolated dict subst

When duplicating interpolated object type, need to increment ref count of the key to offset the decrement during free.

Also remove type-specific dup for dict-substitution which is not needed since it does nothing different from the default dup.

Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: f893b07848 user: steveb@workware.net.au tags: trunk

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to jim-exec.c.

962
963
964
965
966
967
968






969
970
971
972
973
974
975
            if (arg_array[lastArg][0] == '|') {
                if (arg_array[lastArg][1] == '&') {
                    pipe_dup_err = 1;
                }
                break;
            }
        }






        /* Replace | with NULL for execv() */
        arg_array[lastArg] = NULL;
        if (lastArg == arg_count) {
            outputId = lastOutputId;
        }
        else {
            if (JimPipe(pipeIds) != 0) {







>
>
>
>
>
>







962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
            if (arg_array[lastArg][0] == '|') {
                if (arg_array[lastArg][1] == '&') {
                    pipe_dup_err = 1;
                }
                break;
            }
        }

        if (lastArg == firstArg) {
            Jim_SetResultString(interp, "missing command to exec", -1);
            goto error;
        }

        /* Replace | with NULL for execv() */
        arg_array[lastArg] = NULL;
        if (lastArg == arg_count) {
            outputId = lastOutputId;
        }
        else {
            if (JimPipe(pipeIds) != 0) {