summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* unposted: zsh-merge-changelog: find even more contextHEADmasterdana31 hours2-1/+4
| | | | mikael posted an even larger batch of changes that broke this assumption again
* github #169: update change logdana31 hours1-0/+2
|
* github #169: completion: remove _darcsdana31 hours1-63/+0
| | | | now provided by up-stream (see previous commit)
* github #169: completion: update _darcs from up-streamdana31 hours2-15/+43
| | | | | | this function is now provided by the up-stream project, so it will be removed from the zsh distribution. this commit exists to back-port into 5.9.1 -- i felt the history might be confusing if the update appeared only in that branch
* github #161 (tweaked): zkbd: allow zkbd to generate config in a custom directorysph32 hours3-5/+17
| | | | + check for empty arg
* github #170 (tweaked): Clarify the documentation about -d flag in compaddMichael Baikov32 hours2-2/+11
| | | | + adjusted quote placement
* 54525: interrupt during redirect to fifo doesn't run precmdMikael Magnusson39 hours2-1/+7
| | | | | | Even though we clear errflag here, there can be a queued signal that will run when we try to execute precmd and that will set errflag again, aborting precmd after all. Let the signals through here instead.
* 54569: zle: various issuesMikael Magnusson39 hours15-70/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | historysearchforward advanced zlecs instead of histpos (historysearchbackward already correctly uses CCRIGHTPOS(histpos) ST is actually 0x9c per ctlseqs.txt ESC \ String Terminator (ST is 0x9c). fix plenty of indexing confusion with prompt_markers(), it was never returning pre because markers did not include it. constants were compared against the wrong variable, or using the wrong hardcoded index (and those indices also changed now that pre is in markers). in bracketedstring, the imeta(next) branch writes two bytes to pbuf, make sure they both fit. only reallocate once in sizeline, and correct the comment for stringaszleline, though I don't think anyone will do that. putreplaceselection used a stale buffer in the following scenario: % blah set region to bl with cursor on a, hit ctrl-k, then invoke put-replace-selection via alt-x or bind it in advance. ==10588== Invalid read of size 2 ==10588== by 0x6588FAA: pastebuf (zle_misc.c:597) ==10588== by 0x65895A6: putreplaceselection (zle_misc.c:720) ==10588== Address 0x6219550 is 0 bytes inside a block of size 16 free'd ==10588== at 0x483C17B: free (vgpreload_memcheck-amd64-linux.so) ==10588== by 0x65A347A: cuttext (zle_utils.c:1023) ==10588== Block was alloc'd at ==10588== at 0x483E82F: realloc (vgpreload_memcheck-amd64-linux.so) ==10588== by 0x65A34E8: cuttext (zle_utils.c:1028) also set clear so the stringaszleline allocation is freed in the same function, and fix the same leak in viputbefore and viputafter. fix out of bounds access in vimatchbracket ==11986== Invalid read of size 4 ==11986== at 0x658D14C: vimatchbracket (zle_move.c:645) fix out of bounds access in backwardmetafiedchar, this one won't cause a valgrind warning because the memory is owned by us. fix two separate leaks (impressive) when assigning to $registers special zle parameter ==16615== 2,799,972 bytes in 99,999 blocks are definitely lost in loss record 631 of 631 ==16615== at 0x48397B5: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==16615== by 0x473836: zalloc (mem.c:966) ==16615== by 0x65A1EEC: stringaszleline (zle_utils.c:440) ==16615== by 0x658EF17: set_register (zle_params.c:775) ==16615== 599,988 bytes in 99,998 blocks are definitely lost in loss record 630 of 631 ==16615== at 0x48397B5: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==16615== by 0x473836: zalloc (mem.c:966) ==16615== by 0x4AA101: ztrdup (string.c:68) ==16615== by 0x435536: addvars (exec.c:2604) don't crash on 'bindkey x foo; zle -l foo' ==21910== Process terminating with default action of signal 11 (SIGSEGV) ==21910== Access not within mapped region at address 0x0 ==21910== at 0x6597303: bin_zle_list (zle_thingy.c:406) ==21910== by 0x6597229: bin_zle (zle_thingy.c:388) restore keymap and zmod when erroring out of bin_zle_call inststrlen used the wrong len to advance zlecs which would cause it to advance way past the end of zleline. fortunately this function is never called with zlemetaline == NULL. fix expand-cmd-path to not just move the cursor an arbitrary amount forward, and convert the indices from zlemetaline to zleline. bangq in magicspace could be used after zleline was realloc()d, calculate the offset before calling selfinsert() the memo field wasn't always freed for region highlights vi-indent was skipping the last line for 4+ line ranges vi-unindent buffer overrun ==3900== Conditional jump or move depends on uninitialised value(s) ==3900== at 0x65A3CE6: findeol (zle_utils.c:1180) ==3900== by 0x65A6E01: viunindent (zle_vi.c:880) break the loop on eof in vi-caps-lock-panic, though we do exit anyway when the terminal closes off by one in condition in vi-backward-word-end, this only prevented us moving to the start of the buffer if we were on the second character exactly. seq in cursor_form() was one byte too small to fit the nul terminator: zsh% zle_cursorform=( edit:steady,color=\#abcdef ) Breakpoint 1, cursor_form () at termquery.c:987 987 if (s - seq) (gdb) p s - seq $1 = 31 fix negation of h-3 in setmstatus. this was very noticable in interactive menu selection if you typed a long string. the entire string would be replaced by three dots instead of just the start of it.
* 54568: zformat: fix some misparse and overrun issuesMikael Magnusson39 hours3-5/+12
| | | | | | | | | | | | Not closing a %( would simply read garbage memory % zformat -f result 'before%(a-after' 'a:hello' ; echo $result beforeaftera:hello % zformat -f result 'before%(a-after' 'a:hello' ; echo $result beforeafter# It was possible to overwrite the %% and %) sequences with arbitrary text, and %% was also undocumented. Hopefully nobody relied on this spacekey heater.
* 54567: zselect: don't pass fd>=FD_SETSIZE to FD_SETMikael Magnusson39 hours2-0/+7
| | | | | | | | | | | | | | | | | | | zsh% zselect 2023 ==2815== Syscall param select(exceptfds) points to uninitialised byte(s) ==2815== at 0x4DDA2D6: select (in /lib64/libc-2.32.so) ==2815== by 0x4885937: bin_zselect (zselect.c:175) ==2815== by 0x410C5E: execbuiltin (builtin.c:506) ==2815== by 0x43A5FC: execcmd_exec (exec.c:4259) ==2815== by 0x433BE1: execpline2 (exec.c:2040) ==2815== by 0x432824: execpline (exec.c:1765) ==2815== by 0x431A7D: execlist (exec.c:1515) ==2815== by 0x4310E3: execode (exec.c:1296) ==2815== by 0x457D15: loop (init.c:223) ==2815== by 0x45C151: zsh_main (init.c:1933) ==2815== by 0x40FD61: main (main.c:93) ==2815== Address 0x1ffeffe5b0 is on thread 1's stack ==2815== in frame #1, created by bin_zselect (zselect.c:66) zselect: error on select: bad file descriptor
* 54566: zpty: fix some issuesMikael Magnusson39 hours2-15/+33
| | | | | | | | | | | | | | | | | | | | | checkptycmd would sign extend a 0xff byte to -1, causing the byte to be dropped, read into an unsigned char instead the "last despairing effort" code read directly into the int, which would probably not work on big endian. read into a temporary unsigned char instead the FIONREAD path used a totally undeclared variable "val", declare it, and also initialize pollret to -1 for this path the USE_CYGWIN_FIX path error message would always report -1 as the fd it was unable to duplicate, report the original fd instead initial read before the main loop in ptyread forgot to metafy the byte avoid calling malloc with 0 length as this may be misinterpreted as oom don't try to open sfd if opening mfd failed
* 54565: watch: increase a quite tight bound on format lengthMikael Magnusson39 hours2-3/+7
| | | | | And also make sure metafy won't write outside the buffer, it can in theory become twice as long, so use half the buffer size at most.
* 54564: termcap, terminfo: reset u, fix metafy confusionMikael Magnusson39 hours3-23/+52
| | | | | | | | | | | | | | Ideally, these should just be unmetafy()d and passed to ncurses, but the reality is that ncurses will just segfault if we do that when the user passes a non-ascii value. % echo $terminfo[らしりれ] zsh: segmentation fault % echotc れりの zsh: segmentation fault The tparm values do seem to work fine with multibyte strings, so do unmetafy() for those.
* 54563: stat, system: minor fixesMikael Magnusson39 hours3-4/+8
|
* 54562: random: Fix some bugs in the random moduleMikael Magnusson39 hours4-32/+41
| | | | | | | | | | | | | | | | % echo $(( zrand_int(4294967295) )) zsh: Upper bound (4294967295) out of range: 0-4294967295 3910196459 read loop had incorrect condition as well as passing negative status codes on to the pointer arithmetic clz64 shifted by 1 bit instead of 2 remove incorrect comment (it applies to the case where max is 1, which is not very interesting) and some minor stuff
* 54561: regex: regfree on pattern where regcomp failed could be undefined ↵Mikael Magnusson39 hours2-1/+4
| | | | behavior
* 54560: parameter: Fix some issues in the parameter moduleMikael Magnusson39 hours2-17/+28
| | | | | | | | | | | | | | | use strtol, not strtod use WEXITSTATUS on returned status, though I'm not sure when this path can actually be taken? don't abort getting group names just because one name is missing storing ${(kv)parameters} in a copy and then reading that wouldn't say what type a nameref pointed to setting multiple options via options=( foo on ) didn't verify the option name before trying to set it, reporting it as a failure to set it instead
* 54559: nearcolor was missing the third grayscale entry in 88 color modeMikael Magnusson39 hours2-6/+15
| | | | | | Adding a test for this is not trivial since tccolours is set directly from a termcap lookup, and is specifically documented in the code as "may not be set".
* 54558: ksh93: .sh.match handling with KSHARRAYS set was totally brokenMikael Magnusson39 hours2-4/+9
| | | | | | | If (#m) was not active, the getsparam("MATCH") is always NULL, terminating the whole array. Copying zsh_match into *ap didn't advance the pointer, NULL terminating the pointer again. The array length was one short (MATCH in front and NULL terminator means it should be +2).
* 54557: langinfo: fix some metafy confusionMikael Magnusson39 hours2-9/+7
| | | | | In practice, name is always ascii so this is all no-op anyway, but just in case someone models code on this, make it less likely to confuse them.
* 54556: langinfo.mdd check was always trueMikael Magnusson39 hours2-1/+4
|
* 54555: fix in 52783 was incomplete, add same check in scangroup()Mikael Magnusson39 hours2-0/+7
| | | | | | | | | | | % typeset -A .zle.hlgroups % zmodload -i zsh/hlgroup % : ${.zle.hlgroups[select]} % print ${(k).zle.esc} zsh: segmentation fault Also add check on !hlg too for paranoia, not sure if that can actually happen, but getgroup has the same check.
* 54554: curses: use setcchar in zccmd_bg if availableMikael Magnusson39 hours2-2/+41
| | | | This allows using more than 256 color pairs.
* 54553: curses: free subwindows before parents or they don't get freed at allMikael Magnusson39 hours2-10/+28
|
* 54552: curses: fix a few issuesMikael Magnusson39 hours2-34/+32
| | | | | | | | | | | | | | | | | | | | | | | mouseinterval returns the old mouse interval, not a ok/err status. mousemask returns 0 on failure zccmd_bg called wattron/off directly for attributes, instead of storing them in the ch variable being passed to wbkgd so they weren't actually applied to the background. remove some extra 0 being passed to zwarnnam, and change one from zerrnam. fix a leak of w->children when deleting windows. check return value from mbrtowc and wctomb correctly. store attrs correctly in non-multibyte path. return error from zcurses position when given an invalid parameter name. if init_pair fails, retry with the same number next time.
* 54551: clone: minor style issueMikael Magnusson39 hours2-3/+5
|
* 54550: cap: fix leaksMikael Magnusson39 hours2-10/+18
|
* 54549: attr: various minor issuesMikael Magnusson39 hours3-4/+9
| | | | | | | | | | | The flags parameter is always 0 so the precedence mistake doesn't actually matter. Attributes are quite unlikely to be over 2GB in length, but use the correct types. The module is load=no so the autofeatures isn't used, but be consistent and list all builtins in the mdd file.
* 54546: Remove incorrect array access that was also never usedMikael Magnusson39 hours2-1/+4
| | | | | | | | | | | | | c always comes from ingetc() which does this, if (itok(lastc = (unsigned char) *inbufptr++)) continue; so it is 1) always in the range 0-255, and 2) never an itok character. That means that the access ztokens[c - Pound] where Pound is a signed integer would be accessing an element in the range 164-419 or so, while ztokens is 30 elements large. Luckily two wrongs made a right here, but still, remove it.
* 54545: A few very minor things coverity complained aboutMikael Magnusson39 hours6-5/+12
| | | | | | | | | | | | | | | | | | | | | | Coverity CID 1692322 in Src/glob.c: i'm pretty sure this is a false positive so add a debug message just in case Coverity CID 1500752 in Src/Zle/compresult.c: remove unused assignment that also reads uninitialized pointer p And two that were just near other things it complained about Src/utils.c: Warn if maildir disappeared from under us Src/Modules/system.c: stray \n in zwarn message Src/subst.c: Use DIGBUFSIZE for buf holding digits This one would be a little hard to overflow in practice, you'd need a parameter at least 100000000000000 characters long, which is 100TB.
* 54544: Coverity CID 439086 fix potential leak of prog in ptyread()Mikael Magnusson39 hours2-0/+5
| | | | | | | This was originally marked as a false positive because the allocation was done with PAT_STATIC; when that was later changed to PAT_ZDUP to avoid problems with signal handlers stomping on the memory, apparently this cleanup path was missed.
* 54543: Coverity CID 1692315 memcpy of uninitialized member winsizeMikael Magnusson39 hours2-1/+4
| | | | I think this is not actually a problem but might as well initialize it.
* 54542: Coverity CID 1692320 fix leak of match1Mikael Magnusson39 hours2-1/+6
|
* 54541: Coverity CID 1255748 check return value from stat()Mikael Magnusson39 hours2-2/+4
| | | | | Not doing this would store garbage in dirsav d when . had been deleted, or otherwise unable to be stat()ed.
* 54540: Coverity CID 1637388 avoid clobbering sigMikael Magnusson39 hours2-2/+5
| | | | | When rtsigno returns 0, we want to keep the old sig so we can say it is an unknown signal in the next condition.
* 54539: Coverity CID 1692314 avoid overflowing version field in dump headerMikael Magnusson39 hours2-1/+4
| | | | | This would only happen if you at compile time make the version string 40 characters or longer, which would be quite silly.
* 54538: Coverity CID 1637382 bsiz can overflow when reading a large heredocMikael Magnusson39 hours2-2/+6
| | | | | | Use a size_t and explicit size check, although presumably the realloc will fail long before we get to this point. In theory if we did, though, the code would loop forever with bsiz==0 which wouldn't be great.
* 54537: Coverity CID 1372427 buffer overrun in zexecve()Mikael Magnusson39 hours2-2/+6
| | | | | | | This one is probably harmless, it's in BSS and we're about to throw away our entire address space. Ironically I think this change doesn't actually fix the CID because it's complaining about the strcpy, but pth will always fit in buf, the problem is pwd.
* 54536: Coverity CID 1255827 Fix leak of prog in loadautofn()Mikael Magnusson39 hours2-4/+10
|
* 54535: Coverity CID 1500747 0-initialize tiMikael Magnusson39 hours2-0/+3
| | | | | | This isn't strictly necessary but it's done a few lines above for the -s branch so it's at least consistent if we do the same thing in both places.
* 54548: zftp: fix some mistakesMikael Magnusson39 hours2-11/+9
| | | | | | | | The freesession function randomly clearing the current session instead of the passed section is probably not great. The h_errno definition is repeated just above identically, which I would assume is a compile time error for anyone who has USE_LOCAL_H_ERRNO set.
* 54533: _gcc: fix some funny autogenerated artifacts and other typosMikael Magnusson39 hours2-46/+39
|
* 54532: completers: various small fixesMikael Magnusson40 hours17-29/+39
| | | | | | | | | | | | | | | | | | | _find: - and + were reversed compared to the disp string _zstyle: fix typo breaking chpwd-specific style completion _sudo: minor typo in exclusion list _rsync: fix some minor thinkos _ip: fix a few typos _sort: remove double --ignore-nonprinting line _df: fix typo widge -> wedge _tmux: fix various issues _mount: defperm confusion _sed: typo _netstat: fix -4/-6 typo _wget: fix some syntactical typos _subversion: fix using wrong cache name _lsof: typo _ffmpeg: fix copy-pasto in for scodecs _ansible: --skip-tags also takes tags
* 54531: completers: remove spurious ; in "case $foo; in"Mikael Magnusson40 hours10-12/+20
|
* 54530: Fix typo in default value for avoid-completerMikael Magnusson40 hours3-2/+7
|
* 54325: docs: swap eval contexts for <(...) and >(...)dana2 days2-2/+5
|
* 54425+54429+54449: compdef -[kK]: avoid forkingCharles Blake2 days2-3/+6
|
* unposted: zsh-merge-changelog: find more contextdana3 days2-1/+5
| | | | 30 lines wasn't enough to find the header for mikael's recent batches
* 54527: don't start a vi change from emacs modeOliver Kiddle3 days2-1/+4
|
* 54528: completion option updates and minor cleanupsOliver Kiddle3 days18-120/+336
|