summaryrefslogtreecommitdiffstats
path: root/Src/Modules
Commit message (Collapse)AuthorAgeFilesLines
* unposted: fix missing return keyword in 54552HEADmasterMikael Magnusson4 hours1-1/+1
|
* 54580: zformat: better handle literal % in format stringdana15 hours1-5/+10
|
* 54568: zformat: fix some misparse and overrun issuesMikael Magnusson6 days1-4/+8
| | | | | | | | | | | | 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 Magnusson6 days1-0/+4
| | | | | | | | | | | | | | | | | | | 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 Magnusson6 days1-15/+31
| | | | | | | | | | | | | | | | | | | | | 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 Magnusson6 days1-3/+4
| | | | | 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 Magnusson6 days2-23/+49
| | | | | | | | | | | | | | 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 Magnusson6 days2-4/+5
|
* 54562: random: Fix some bugs in the random moduleMikael Magnusson6 days2-21/+24
| | | | | | | | | | | | | | | | % 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 Magnusson6 days1-1/+1
| | | | behavior
* 54560: parameter: Fix some issues in the parameter moduleMikael Magnusson6 days1-17/+25
| | | | | | | | | | | | | | | 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 Magnusson6 days1-6/+12
| | | | | | 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 Magnusson6 days1-4/+6
| | | | | | | 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 Magnusson6 days1-9/+4
| | | | | 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 Magnusson6 days1-1/+1
|
* 54555: fix in 52783 was incomplete, add same check in scangroup()Mikael Magnusson6 days1-0/+4
| | | | | | | | | | | % 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 Magnusson6 days1-2/+38
| | | | This allows using more than 256 color pairs.
* 54553: curses: free subwindows before parents or they don't get freed at allMikael Magnusson6 days1-10/+25
|
* 54552: curses: fix a few issuesMikael Magnusson6 days1-34/+30
| | | | | | | | | | | | | | | | | | | | | | | 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 Magnusson6 days1-3/+3
|
* 54550: cap: fix leaksMikael Magnusson6 days1-10/+16
|
* 54549: attr: various minor issuesMikael Magnusson6 days2-4/+6
| | | | | | | | | | | 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.
* 54545: A few very minor things coverity complained aboutMikael Magnusson6 days1-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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 Magnusson6 days1-0/+2
| | | | | | | 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.
* 54542: Coverity CID 1692320 fix leak of match1Mikael Magnusson6 days1-1/+3
|
* 54548: zftp: fix some mistakesMikael Magnusson6 days1-11/+7
| | | | | | | | 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.
* 54495: Add ztcp -s to shutdown a tcp fdMikael Magnusson11 days2-5/+48
| | | | | This lets you close tcp connections without losing data. Updating zshtcpsys is left as an exercise for someone else.
* 54494: Add zsocket -s to shutdown() a socket fdMikael Magnusson11 days1-1/+12
|
* 54493: socket: fix some issues with socket nameMikael Magnusson11 days1-1/+10
| | | | | | | | | | | | | | | | | | | | | If the passed name was too long, it was silently truncated. If it was exactly the max length, the string was not nul terminated. % zsocket -l aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ==421== Syscall param socketcall.bind(my_addr.sun_path) points to uninitialised byte(s) ==421== at 0x4DD77D7: bind (in /lib64/libc-2.32.so) ==421== by 0x61FB31A: bin_zsocket (in /usr/local/lib64/zsh/5.9.0.3-test-mika/zsh/net/socket.so) ==421== by 0x4217BF: execbuiltin (in /usr/local/bin/zsh) ==421== by 0x433751: execcmd_exec (in /usr/local/bin/zsh) ==421== by 0x433D2B: execpline2 (in /usr/local/bin/zsh) ==421== by 0x434084: execpline (in /usr/local/bin/zsh) ==421== by 0x4359F8: execlist (in /usr/local/bin/zsh) ==421== by 0x4362A1: execode (in /usr/local/bin/zsh) ==421== by 0x44F7A1: loop (in /usr/local/bin/zsh) ==421== by 0x450AAD: zsh_main (in /usr/local/bin/zsh) ==421== by 0x4D01E69: (below main) (in /lib64/libc-2.32.so) ==421== Address 0x1ffeffd7ad is on thread 1's stack ==421== in frame #1, created by bin_zsocket (???:)
* 54383: Fix WATCH/watch tyingPhilippe Altherr2026-04-301-11/+4
|
* 54376: zparseopts: use standard option parsingdana2026-04-291-141/+50
|
* 54381: zparseopts -M: use last as-given option name in arraysdana2026-04-291-1/+1
|
* 54402: Fix crash in pcre_callout with numerical callout 0Mikael Magnusson2026-04-281-1/+1
| | | | We don't use numerical callouts at all, and we should probably document that, but not crashing is at least a more useful behavior. While it is true that callout_number is always 0 for string callouts, it is not true that it is never 0 for numerical callouts, so check that we got a string too.
* 54362: zparseopts: support empty optspecdana2026-04-191-1/+6
|
* 54361 (tweaked): zparseopts: print friendlier usage errors, add -n optiondana2026-04-191-6/+17
| | | | tweaked to adjust order of options in documentation
* 54181, 54331: remove support for restricted shellOliver Kiddle2026-04-142-10/+5
| | | | | This is in response to a security report. There are too many potential ways to break out of a restricted shell and more secure, modern alternatives exist.
* 54318: mathfunc: add isnan() and isinf(). also document NaN + Infdana2026-04-131-0/+14
|
* 54159: strftime: respect empty TZdana2026-04-051-1/+1
| | | | + README update due to potential compatibility breakage
* 53299: zparseopts: improve accuracy of bad-option messagedana2026-04-051-1/+1
|
* 53776: Add PM_NAMEREF to PM_TYPE, reject array initializers for namerefsPhilippe Altherr2026-02-162-3/+5
|
* 54063: Simplifications for resolve_nameref() and setscope()Philippe Altherr2026-02-161-1/+1
|
* 54093 (tweaked per 54101): Cleanup isarr fields and variablesPhilippe Altherr2025-11-244-8/+8
|
* 54074, 54082: add an opaque key for use in zle_highlight/region_highlight to ↵Oliver Kiddle2025-11-171-1/+1
| | | | allow mixing of colours
* 54075: allow highlighting to be reset in prompts using %H without following ↵Oliver Kiddle2025-11-171-1/+2
| | | | braces
* 54043, 54055: allow highlighing attributes to be turned back offOliver Kiddle2025-11-122-2/+2
|
* 54019: AIX support fixesOliver Kiddle2025-11-031-0/+4
|
* 53988: fix zparseopts segfaultJoshua Krusell2025-10-241-0/+4
|
* 53588: zsystem flock: handle optargs in the same worddana2025-05-131-3/+3
| | | | with small tweak to test, just in case
* 53483: zparseopts -G: accept only '--' as parsing terminatordana2025-04-191-3/+3
|
* 53482: zparseopts -G: always add options with optional args to array with =dana2025-04-191-3/+3
|