mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
This commit fixes two different crashes related to kshdb: - When redirect is given an invalid file descriptor, a segfault no longer occurs. Reproducer: $ ksh -c 'redirect 9>&200000000000' - Fix a crash due to free(3) being used on an invalid pointer. This can be reproduced with kshdb (commands from att/ast#582): $ git clone https://github.com/rocky/kshdb.git $ cd kshdb $ ksh autogen.sh $ echo "print hi there" > $HOME/.kshdbrc $ ./kshdb -L . test/example/dbg-test1.sh src/cmd/ksh93/bltins/misc.c: b_dot_cmd(): - The string pointed to by shp->st.filename must be able to be freed from memory with free(3), so duplicate the string with strdup(3). src/cmd/ksh93/sh/io.c: sh_redirect(): - Show an error message when a file descriptor is invalid to fix a memory fault.
20 lines
1.4 KiB
C
20 lines
1.4 KiB
C
/***********************************************************************
|
|
* *
|
|
* This software is part of the ast package *
|
|
* Copyright (c) 1982-2012 AT&T Intellectual Property *
|
|
* and is licensed under the *
|
|
* Eclipse Public License, Version 1.0 *
|
|
* by AT&T Intellectual Property *
|
|
* *
|
|
* A copy of the License is available at *
|
|
* http://www.eclipse.org/org/documents/epl-v10.html *
|
|
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
|
* *
|
|
* Information and Software Systems Research *
|
|
* AT&T Research *
|
|
* Florham Park NJ *
|
|
* *
|
|
* David Korn <dgk@research.att.com> *
|
|
* *
|
|
***********************************************************************/
|
|
#define SH_RELEASE "93u+m 2020-07-19"
|