1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-23 17:01:05 +02:00
Commit graph

8299 commits

Author SHA1 Message Date
Mikael Magnusson
573679c34b select: Fix leak of 256 bytes on every loop when zle is not used
Reproduce by
yes | head -n 1000000 | zsh -c 'select foo in a b c; do done; sleep 30; echo'

Found by Coverity (Issue 439082).
2015-01-10 08:48:18 +01:00
Mikael Magnusson
7dcaa2ff60 hist: remove wrong NULL terminator
This actually writes a NULL to some arbitrary location in the caller function's stack. Found by Coverity (Issue 1255746).
2015-01-10 08:48:18 +01:00
Peter Stephenson
cfd91eac07 Rearrange context saving.
Variables are now associated with the module that declares them, being
initialised and saved/restored there.  However, as many variables are
used for communication between modules, many of them are set in multiple
places, so the assignment is ambiguous.
2015-01-09 21:33:39 +00:00
Peter Stephenson
6291d38848 34182: doc: to add zf_\* builtins use zmodload -m -F 2015-01-09 17:24:16 +00:00
Mikael Magnusson
62b0e611ce 30568: Add tetriscurses contrib function, port of tetris to zcurses 2015-01-09 12:49:56 +01:00
Mikael Magnusson
bc55ddf364 Fix a typo in bin_print error message 2015-01-09 12:37:25 +01:00
Peter Stephenson
c0d01a6fe0 Fix command substitutions to parse contents as they are read in.
Do this by refactoring misnamed lexsave()/lexrestore() to allow
continuity of history and input.

Add test.
2015-01-08 12:24:00 +00:00
Barton E. Schaefer
93846edb0d 34154/34155: reorder bin_print() to avoid leaking the output descriptor when incorrect/incompatible options were passed 2015-01-07 22:45:46 -08:00
Jun-ichi Takimoto
152b797596 34144: allocate origline by ztrdup(), not by dupstring()
If origline is allocated in heap, it will have been freed
when menuselect() is called directly as a widget.
2015-01-07 21:48:28 +09:00
Mikael Magnusson
b11f7a7e30 unposted: Convert spaces to tabs in ChangeLog 2015-01-06 23:51:19 +01:00
Bart Schaefer
8fea30a571 34122: module: allow NULL third argument as intended
Found by Coverity.
2015-01-06 23:51:19 +01:00
Mikael Magnusson
4701b05cf7 34138: wcs_nicechar: only deref widthp if it was given 2015-01-06 23:51:18 +01:00
Mikael Magnusson
38dc59907b 34120: compctl, jobs: Check contents instead of array
text is an array in the struct, and can never be null.

Found by Coverity (Issue 1255780).
2015-01-06 23:51:01 +01:00
Mikael Magnusson
c425cc9632 34108: Don't leak ifs stuff
Found by Coverity (Issue 1255785).
2015-01-06 23:51:00 +01:00
Mikael Magnusson
6a5339fdd5 34107: getsubsargs: free ptr1 before returning
Found by Coverity (Issue 439073).
2015-01-06 23:51:00 +01:00
Mikael Magnusson
bd2175fe7d 34134: anon funcs: don't leak shf and related data
Found by Coverity (Issue 439076).
2015-01-06 23:50:37 +01:00
Mikael Magnusson
1507719d0a 34112: typeset: fix leak of oldval
Found by Coverity (Issue 1255803).
2015-01-06 23:47:30 +01:00
Mikael Magnusson
adae710eb0 34106: hist: use zhtricat instead of tricat
Found by Coverity (Issue 1255769).
2015-01-06 23:47:23 +01:00
Mikael Magnusson
5a9be69185 34113: whence: use dupstring to not leak memory
All other assignments to buf use the heap, and it's never freed. Found
by Coverity (Issue 1255786).
2015-01-06 23:47:12 +01:00
Mikael Magnusson
8035794a56 34119: complist: Fix leak of string in clnicezputs
Found by Coverity (Issue 1255808).
2015-01-06 23:47:05 +01:00
Mikael Magnusson
6c72895bc2 34105: subst: remove dead code
Found by Coverity (Issue 1255810).
2015-01-06 23:46:55 +01:00
Mikael Magnusson
9e5dc2925c 34121: compresult: Remove unneeded NULL check
The variable is set to  if NULL at the start of the function, and derefed
on the previous line. Found by Coverity (Issue 1255843).
2015-01-06 23:46:49 +01:00
Mikael Magnusson
ea6bb993e9 34104: compctl: Remove pointless check
cc has already been derefed a bunch of times leading up to here. Found
by Coverity (Issue 1255841).
2015-01-06 23:46:31 +01:00
Mikael Magnusson
221ecf5010 34115: compcore: Fix size argument to zfree
Found by Coverity (Issue 1255852), has no impact unless using
--enable-zsh-mem, and even then it is minimal.
2015-01-06 23:46:18 +01:00
Mikael Magnusson
18b60d8512 34117: zle: size_t is unsigned, use int instead
The function wctomb returns an int according to my manpage, and we
furthermore check if it is negative, and then return it, and the function
signature is int, so declaring it as an int seems to make more sense.
2015-01-06 23:46:06 +01:00
Mikael Magnusson
c935381479 34116: computil: Check for NULL before passing to strlen
The rest of this function appears to be very careful about checking these,
then forgets in this one spot. Found by Coverity (Issue 1255805).
2015-01-06 23:45:51 +01:00
Mikael Magnusson
6b79f29fb2 34118: Don't crash when writing out history if HOST is unset
Found by Coverity (Issue 1255793).
2015-01-06 23:45:26 +01:00
Mikael Magnusson
a150563fb0 34114: emulate: Handle aborting from mixed -L/-c correctly
Somehow Coverity found this (Issue 1255797, Failure to restore non-local value).
2015-01-06 23:45:09 +01:00
Barton E. Schaefer
7e7449592a 34103: fix ancient double-quote handling thinko in subst_parse_str()
This doesn't seem to have mattered, but must in some obscure cases
2015-01-06 09:34:12 -08:00
Barton E. Schaefer
f9cc5a6e56 34093: "whence" should always return nonzero when it finds that nothing matches its arguments 2015-01-06 09:33:44 -08:00
Daniel Shahaf
c7850ac4f6 34042: _git: Respect tags for subcommand completion.
It is now possible to use the tag-order style to stagger the overwhelming
'git <TAB>' subcommand listing.  For example:

    zstyle ':completion::complete:git:argument-1:' tag-order \
        main-porcelain-commands user-commands third-party-commands \
        ancillary-manipulator-commands ancillary-interrogator-commands \
        plumbing-manipulator-commands plumbing-interrogator-commands \
        aliases
2015-01-05 15:57:42 +00:00
Timofey Titovets
6425db14a4 34053: complete additional Linux kernel module compression 2015-01-05 10:21:29 +00:00
Peter Stephenson
98f465c09f 34092: fix miscount of symlink resolution for "..".
This caused problems with expanding a path with ".." in "whence -S".
2015-01-04 19:42:45 +00:00
Peter Stephenson
f9cba834cd 34091: typo with "whence -s" expansions 2015-01-04 19:05:39 +00:00
Peter Stephenson
aa622e0801 users/19682: document recommended use of whence 2015-01-04 00:28:03 +00:00
Peter Stephenson
454bb777cf users/19671: remove confusion with whence -a.
If the argument is a full path don't try to search the path for it.
2015-01-02 22:25:24 +00:00
Peter Stephenson
33d1439fdb users/19667: whence -S shows intermediate steps in symlink expansion 2015-01-02 21:32:51 +00:00
Peter Stephenson
b83aa727ca 34077: further tests for return status from "for" loops 2015-01-02 21:16:41 +00:00
Mikael Magnusson
2194da18c7 33963: remove work of art in _mount 2014-12-29 08:34:34 +01:00
Daniel Shahaf
e11ad500dd 34070: fix starting position for memset() from 34005. 2014-12-28 20:11:09 -08:00
Barton E. Schaefer
33b3958064 34068: create tempfiles without forking, and safe temp directory creation 2014-12-28 00:49:08 -08:00
Barton E. Schaefer
200accac63 34067: safe tempfile creation, part 1 2014-12-27 23:59:29 -08:00
Takeshi Banse
1cd8023570 34064: assignment before command replaces array with export even when KSH_ARRAYS 2014-12-27 22:05:05 -08:00
Barton E. Schaefer
d6a32ddeed 34065: following an "if" condition, do not test lastval for ERR_EXIT until a new command is run
Includes unposted regression tests.
2014-12-27 21:55:58 -08:00
Daniel Shahaf
89c692eafb 33977: don't complete widgets as first argument to bindkey 2014-12-21 22:23:06 +01:00
Peter Stephenson
89012cf94c 34015: disallow strange environment variable names.
These are ones with the top bit set in any character.
Don't import them, and don't export them.
2014-12-19 22:15:24 +00:00
Peter Stephenson
fd934e1187 34005: region_highlights memory fix
Zero uninitialised part of memory when reallocing
2014-12-19 21:55:31 +00:00
Barton E. Schaefer
95381783e9 34002: zshcalloc() in init_keymaps() 2014-12-18 18:58:25 -08:00
Barton E. Schaefer
bf075b9e0d 33992: do not attempt attachtty() for process group zero (which is possible in a linux pid namespace) 2014-12-18 18:58:25 -08:00
Peter Stephenson
ecef922df1 34008: metafy the environment on arrival in the shell 2014-12-18 19:55:53 +00:00