Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package yascreen for openSUSE:Factory checked in at 2026-03-18 16:50:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yascreen (Old) and /work/SRC/openSUSE:Factory/.yascreen.new.8177 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yascreen" Wed Mar 18 16:50:33 2026 rev:6 rq:1340820 version:2.11 Changes: -------- --- /work/SRC/openSUSE:Factory/yascreen/yascreen.changes 2025-02-10 18:38:02.806905686 +0100 +++ /work/SRC/openSUSE:Factory/.yascreen.new.8177/yascreen.changes 2026-03-18 16:52:15.297402823 +0100 @@ -1,0 +2,9 @@ +Sun Mar 15 15:23:50 UTC 2026 - Andreas Stieger <[email protected]> + +- update to 2.11: + * ignore non-printable utf code points + * fix a buffer overflow + * fix strdup error handling while copying from mem to scr + * fix (im)possible int*int overflow + +------------------------------------------------------------------- Old: ---- yascreen-2.06.tar.xz yascreen-2.06.tar.xz.asc New: ---- yascreen-2.11.tar.xz yascreen-2.11.tar.xz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yascreen.spec ++++++ --- /var/tmp/diff_new_pack.A6A1ky/_old 2026-03-18 16:52:16.837466299 +0100 +++ /var/tmp/diff_new_pack.A6A1ky/_new 2026-03-18 16:52:16.849466793 +0100 @@ -1,7 +1,7 @@ # # spec file for package yascreen # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,14 +18,15 @@ %define sover 0 Name: yascreen -Version: 2.06 +Version: 2.11 Release: 0 Summary: A terminal control library (ncurses alternative) License: LGPL-3.0-or-later URL: https://github.com/bbonev/yascreen/ Source: %{url}releases/download/v%{version}/yascreen-%{version}.tar.xz Source2: %{url}releases/download/v%{version}/yascreen-%{version}.tar.xz.asc -Source3: https://raw.githubusercontent.com/bbonev/yascreen/v%{version}/debian/upstream/signing-key.asc#/%{name}.keyring +# https://raw.githubusercontent.com/bbonev/yascreen/v%%{version}/debian/upstream/signing-key.asc +Source3: %{name}.keyring %if 0%{?suse_version} && %{?suse_version} < 1599 BuildRequires: gcc12 %endif @@ -77,8 +78,7 @@ %files -n libyascreen0 %license LICENSE -%{_libdir}/libyascreen.so.%{sover} -%{_libdir}/libyascreen.so.%{sover}.* +%{_libdir}/libyascreen.so.%{sover}{,.*} %files devel %license LICENSE ++++++ yascreen-2.06.tar.xz -> yascreen-2.11.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yascreen-2.06/GNUmakefile new/yascreen-2.11/GNUmakefile --- old/yascreen-2.06/GNUmakefile 2025-01-15 17:05:45.000000000 +0100 +++ new/yascreen-2.11/GNUmakefile 2026-03-14 23:18:52.000000000 +0100 @@ -2,7 +2,7 @@ ##################### GNUmakefile is preferred by GNU make ##################### ################################################################################ # -# Copyright © 2015-2025 Boian Bonev ([email protected]) {{{ +# Copyright © 2015-2026 Boian Bonev ([email protected]) {{{ # # SPDX-License-Identifer: LGPL-3.0-or-later # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yascreen-2.06/Makefile new/yascreen-2.11/Makefile --- old/yascreen-2.06/Makefile 2025-01-15 17:05:45.000000000 +0100 +++ new/yascreen-2.11/Makefile 2026-03-14 23:18:52.000000000 +0100 @@ -2,7 +2,7 @@ ################### Makefile is preferred by any other make #################### ################################################################################ # -# Copyright © 2015-2025 Boian Bonev ([email protected]) {{{ +# Copyright © 2015-2026 Boian Bonev ([email protected]) {{{ # # SPDX-License-Identifer: LGPL-3.0-or-later # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yascreen-2.06/Makefile.main new/yascreen-2.11/Makefile.main --- old/yascreen-2.06/Makefile.main 2025-01-15 17:05:45.000000000 +0100 +++ new/yascreen-2.11/Makefile.main 2026-03-14 23:18:52.000000000 +0100 @@ -1,6 +1,6 @@ ############################# configurable section ############################# # -# Copyright © 2015-2025 Boian Bonev ([email protected]) {{{ +# Copyright © 2015-2026 Boian Bonev ([email protected]) {{{ # # SPDX-License-Identifer: LGPL-3.0-or-later # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yascreen-2.06/README.md new/yascreen-2.11/README.md --- old/yascreen-2.06/README.md 2025-01-15 17:05:45.000000000 +0100 +++ new/yascreen-2.11/README.md 2026-03-14 23:18:52.000000000 +0100 @@ -1,4 +1,4 @@ -# YASCREEN 3 "January 15, 2025" yascreen "User-Manual" +# YASCREEN 3 "March 15, 2026" yascreen "User-Manual" # NAME yascreen - Yet Another Screen Library (curses replacement for daemons and embedded apps) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yascreen-2.06/fedora/yascreen.spec new/yascreen-2.11/fedora/yascreen.spec --- old/yascreen-2.06/fedora/yascreen.spec 2025-01-15 17:05:45.000000000 +0100 +++ new/yascreen-2.11/fedora/yascreen.spec 2026-03-14 23:23:17.000000000 +0100 @@ -1,5 +1,5 @@ Name: yascreen -Version: 2.06 +Version: 2.11 Release: 1%{?dist} Summary: Yet Another Screen Library (lib(n)curses alternative) @@ -74,6 +74,18 @@ %{_includedir}/yascreen.h %changelog +* Sat Mar 14 2026 Boian Bonev <[email protected]> - 2.11-1 +- Update to latest ver 2.11 + +* Sat Jan 17 2026 Fedora Release Engineering <[email protected]> - 2.06-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + +* Fri Jul 25 2025 Fedora Release Engineering <[email protected]> - 2.06-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Sun Jan 19 2025 Fedora Release Engineering <[email protected]> - 2.06-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Wed Jan 15 2025 Boian Bonev <[email protected]> - 2.06-1 - Update to latest ver 2.06 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yascreen-2.06/yascreen.3 new/yascreen-2.11/yascreen.3 --- old/yascreen-2.06/yascreen.3 2025-01-15 17:05:53.000000000 +0100 +++ new/yascreen-2.11/yascreen.3 2026-03-14 23:26:53.000000000 +0100 @@ -1,20 +1,17 @@ '\" t .nh -.TH YASCREEN 3 "January 15, 2025" yascreen "User-Manual" +.TH YASCREEN 3 "March 15, 2026" yascreen "User-Manual" .SH NAME -.PP -yascreen - Yet Another Screen Library (curses replacement for daemons and embedded apps) +yascreen \- Yet Another Screen Library (curses replacement for daemons and embedded apps) .SH SYNOPSIS -.PP \fB#include <yascreen.h>\fR .SH DESCRIPTION .SH Main features -.RS .IP \(bu 2 small footprint .IP \(bu 2 @@ -47,8 +44,6 @@ .IP \(bu 2 easy cross compilation setup (by setting CC, AR, STRIP and RANLIB) -.RE - .PP Current development is done on Linux, with additional testing on OpenBSD/FreeBSD; other platforms may need minimal fixes. @@ -56,7 +51,6 @@ On *BSD a \fBgmake\fR is required to build. .SH Architecture -.PP yascreen uses an opaque data structure, allocated by the library and dynamically resized when needed - \fByascreen_init(int sx, int sy)\fR / \fByascreen_resize(yascreen *s, int sx, int sy)\fR\&. An application may specify (0,0) for both calls to let yascreen detect the size or use a fixed size. In case the terminal has zero size or does not support the \fBTIOCGWINSZ\fR \fBioctl\fR, the size will default to 80x24. .PP @@ -156,7 +150,6 @@ .SH API Reference .SH Predefined constants and Helper macros -.PP Internally style is kept into bitfields in a single integer variable - that includes foreground/background colors, style modifiers (bold, italic, underline, inverse and blink. .SS Style codes @@ -217,12 +210,9 @@ All of the above can be or'ed into attribute, provided that the bits for foreground/background color are all zeroes. .SS Key codes -.RS .IP \(bu 2 Special, generated internally -.RE - .PP Previous versions of the library used -1 and 0x100+ for these codes. In order to achieve unicode wide character compatibility and simpler API, the reserved Unicode range 0xf0000-0xffffd is used for the special codes both in narrow and wide character input modes. @@ -245,12 +235,9 @@ T} .TE -.RS .IP \(bu 2 Normal keys -.RE - .TS allbox; l l l @@ -404,12 +391,9 @@ T} .TE -.RS .IP \(bu 2 Extended keys, parsed from ANSI sequences -.RE - .TS allbox; l l l @@ -487,12 +471,9 @@ \fBYAS_K_A_RIGHT\fR 0xf0046 Alt-Right .TE -.RS .IP \(bu 2 Alt-<letter> -.RE - .PP These codes are generated by a helper macro - \fBYAS_K_ALT(keycode)\fR\&. @@ -557,7 +538,6 @@ .TE .SH Functions -.PP All functions in the API work with a pointer to an opaque \fByascreen\fR structure. .PP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yascreen-2.06/yascreen.c new/yascreen-2.11/yascreen.c --- old/yascreen-2.06/yascreen.c 2025-01-15 17:05:45.000000000 +0100 +++ new/yascreen-2.11/yascreen.c 2026-03-14 23:18:52.000000000 +0100 @@ -1,6 +1,6 @@ -// $Id: yascreen.c,v 2.06 2025/01/15 15:57:59 bbonev Exp $ +// $Id: yascreen.c,v 2.11 2026/03/14 22:06:37 bbonev Exp $ // -// Copyright © 2015-2025 Boian Bonev ([email protected]) {{{ +// Copyright © 2015-2026 Boian Bonev ([email protected]) {{{ // // SPDX-License-Identifer: LGPL-3.0-or-later // @@ -137,7 +137,7 @@ int keysize; // saved key storage size int keycnt; // saved key count int *keys; // saved key array - unsigned char ansibuf[20]; // buffer for escape sequence parsing + unsigned char ansibuf[21]; // buffer for escape sequence parsing unsigned char ansipos; // next byte will go in this pos unsigned char sosnbuf[20]; // buffer for telnet SOSN options parsing unsigned char sosnpos; // next byte will go in this pos @@ -318,7 +318,7 @@ return s->phint; } // }}} -static char myver[]="\0Yet another screen library (https://github.com/bbonev/yascreen) $Revision: 2.06 $\n\n"; // {{{ +static char myver[]="\0Yet another screen library (https://github.com/bbonev/yascreen) $Revision: 2.11 $\n\n"; // {{{ // }}} inline const char *yascreen_ver(void) { // {{{ @@ -351,14 +351,14 @@ } } // }}} -static inline void yascreen_free_memcell(yascreen *s,int i) { // {{{ +static inline void yascreen_free_memcell(yascreen *s,size_t i) { // {{{ if (s->mem[i].style&YAS_STORAGE) { free(s->mem[i].p); s->mem[i].style&=~YAS_STORAGE; } } // }}} -static inline void yascreen_free_cell(yascreen *s,int i) { // {{{ +static inline void yascreen_free_cell(yascreen *s,size_t i) { // {{{ yascreen_free_memcell(s,i); if (s->scr[i].style&YAS_STORAGE) { free(s->scr[i].p); @@ -366,14 +366,14 @@ } } // }}} -static inline void yascreen_empty_cell(yascreen *s,int i) { // {{{ +static inline void yascreen_empty_cell(yascreen *s,size_t i) { // {{{ s->mem[i].style=s->scr[i].style=0; s->mem[i].d[0]=' '; s->mem[i].d[1]=0; s->scr[i].d[0]=0; } // }}} -static inline void yascreen_free_empty_cell(yascreen *s,int i) { // {{{ +static inline void yascreen_free_empty_cell(yascreen *s,size_t i) { // {{{ yascreen_free_cell(s,i); yascreen_empty_cell(s,i); } // }}} @@ -391,7 +391,7 @@ inline yascreen *yascreen_init(int sx,int sy) { // {{{ yascreen *s; - int i; + size_t i; if (myver[0]==0) { // reformat the static version string char *rev=strstr(myver+1,"$Revision: "); @@ -472,15 +472,15 @@ return NULL; } s->keysize=KEYSTEP; - s->mem=(cell *)calloc(sx*sy,sizeof(cell)); - s->scr=(cell *)calloc(sx*sy,sizeof(cell)); + s->mem=(cell *)calloc((size_t)sx*sy,sizeof(cell)); + s->scr=(cell *)calloc((size_t)sx*sy,sizeof(cell)); if (!s->mem||!s->scr) { yascreen_free_dynamic(s); free(s); return NULL; } - for (i=0;i<sx*sy;i++) + for (i=0;i<(size_t)sx*sy;i++) strncpy(s->mem[i].d," ",sizeof s->mem[i].d); return s; } // }}} @@ -533,7 +533,7 @@ inline int yascreen_resize(yascreen *s,int sx,int sy) { // {{{ cell *mem,*scr; - int i; + size_t i; if (!s) return -1; @@ -549,21 +549,21 @@ if (s->sx==sx&&s->sy==sy) return 0; - for (i=0;i<s->sx*s->sy;i++) // free old allocated data and set for reusage - if (i<sx*sy) + for (i=0;i<(size_t)s->sx*s->sy;i++) // free old allocated data and set for reusage + if (i<(size_t)sx*sy) yascreen_free_empty_cell(s,i); else yascreen_free_cell(s,i); - if (sx*sy>s->sx*s->sy) { // allocate bigger buffer - mem=(cell *)realloc(s->mem,sx*sy*sizeof(cell)); + if ((size_t)sx*sy>(size_t)s->sx*s->sy) { // allocate bigger buffer + mem=(cell *)realloc(s->mem,(size_t)sx*sy*sizeof(cell)); if (!mem) return -1; s->mem=mem; - scr=(cell *)realloc(s->scr,sx*sy*sizeof(cell)); + scr=(cell *)realloc(s->scr,(size_t)sx*sy*sizeof(cell)); if (!scr) return -1; s->scr=scr; - for (i=s->sx*s->sy;i<sx*sy;i++) // initialize the rest of the area + for (i=(size_t)s->sx*s->sy;i<(size_t)sx*sy;i++) // initialize the rest of the area yascreen_empty_cell(s,i); } s->redraw=1; @@ -574,7 +574,7 @@ } // }}} inline void yascreen_free(yascreen *s) { // {{{ - int i; + size_t i; if (!s) return; @@ -584,7 +584,7 @@ free(s); // most probably will crash, because there is no way to have s partally initialized return; } - for (i=0;i<s->sx*s->sy;i++) + for (i=0;i<(size_t)s->sx*s->sy;i++) yascreen_free_cell(s,i); yascreen_free_dynamic(s); outs(s,ESC"[0m"); @@ -655,16 +655,16 @@ for (j=y1;j<y2;j++) { int skip=1,cnt=0; - if (!redraw&&!(s->mem[s->sx*j].style&YAS_TOUCHED)) // skip untouched lines + if (!redraw&&!(s->mem[(size_t)s->sx*j].style&YAS_TOUCHED)) // skip untouched lines continue; - s->mem[s->sx*j].style&=~YAS_TOUCHED; // mark updated lines as not touched + s->mem[(size_t)s->sx*j].style&=~YAS_TOUCHED; // mark updated lines as not touched for (i=0;i<s->sx;i++) { int diff=redraw; // forced redraw if (!diff) // compare attributes - diff=(s->mem[i+s->sx*j].style&~YAS_INTERNAL)!=(s->scr[i+s->sx*j].style&~YAS_INTERNAL); + diff=(s->mem[i+(size_t)s->sx*j].style&~YAS_INTERNAL)!=(s->scr[i+(size_t)s->sx*j].style&~YAS_INTERNAL); if (!diff) // compare content - diff=!!strcmp((s->mem[i+s->sx*j].style&YAS_STORAGE)?s->mem[i+s->sx*j].p:s->mem[i+s->sx*j].d,(s->scr[i+s->sx*j].style&YAS_STORAGE)?s->scr[i+s->sx*j].p:s->scr[i+s->sx*j].d); + diff=!!strcmp((s->mem[i+(size_t)s->sx*j].style&YAS_STORAGE)?s->mem[i+(size_t)s->sx*j].p:s->mem[i+(size_t)s->sx*j].d,(s->scr[i+(size_t)s->sx*j].style&YAS_STORAGE)?s->scr[i+(size_t)s->sx*j].p:s->scr[i+(size_t)s->sx*j].d); if (diff||!skip) { if (skip) { @@ -679,25 +679,29 @@ cnt=0; } while (cnt>=0) { - nsty=s->mem[j*s->sx+i-cnt].style&~YAS_INTERNAL; + nsty=s->mem[(size_t)j*s->sx+i-cnt].style&~YAS_INTERNAL; if (lsty!=nsty) { yascreen_update_attr(s,lsty,nsty); lsty=nsty; } - outs(s,(s->mem[j*s->sx+i-cnt].style&YAS_STORAGE)?s->mem[j*s->sx+i-cnt].p:s->mem[j*s->sx+i-cnt].d); + outs(s,(s->mem[(size_t)j*s->sx+i-cnt].style&YAS_STORAGE)?s->mem[(size_t)j*s->sx+i-cnt].p:s->mem[(size_t)j*s->sx+i-cnt].d); cnt--; } cnt=0; // loop above leaves cnt at -1 } else cnt++; } - if (s->scr[j*s->sx+i].style&YAS_STORAGE) - free(s->scr[j*s->sx+i].p); - s->scr[j*s->sx+i].style=s->mem[j*s->sx+i].style; - if (s->mem[j*s->sx+i].style&YAS_STORAGE) - s->scr[j*s->sx+i].p=strdup(s->mem[j*s->sx+i].p); - else - strncpy(s->scr[j*s->sx+i].d,s->mem[j*s->sx+i].d,sizeof s->scr[j*s->sx+i].d); + if (s->scr[(size_t)j*s->sx+i].style&YAS_STORAGE) + free(s->scr[(size_t)j*s->sx+i].p); + s->scr[(size_t)j*s->sx+i].style=s->mem[(size_t)j*s->sx+i].style; + if (s->mem[(size_t)j*s->sx+i].style&YAS_STORAGE) { + s->scr[(size_t)j*s->sx+i].p=strdup(s->mem[(size_t)j*s->sx+i].p); + if (!s->scr[(size_t)j*s->sx+i].p) { // make it empty in case of allocation failure + s->scr[(size_t)j*s->sx+i].style&=~YAS_STORAGE; + strcpy(s->scr[(size_t)j*s->sx+i].d," "); + } + } else + strncpy(s->scr[(size_t)j*s->sx+i].d,s->mem[(size_t)j*s->sx+i].d,sizeof s->scr[(size_t)j*s->sx+i].d); } } if (s->cursor) @@ -728,33 +732,35 @@ return; } } + if (width<0) // non-printable character, skip + return; if (s->cursory<0||s->cursory>=s->sy) return; if (width&&s->cursorx>=0&&s->cursorx<s->sx&&s->cursorx+width<=s->sx) { int i; // normal char - yascreen_free_memcell(s,s->cursorx+s->cursory*s->sx); + yascreen_free_memcell(s,s->cursorx+(size_t)s->cursory*s->sx); if (strlen(str)<PSIZE) { - strncpy(s->mem[s->cursorx+s->cursory*s->sx].d,str,sizeof s->mem[s->cursorx+s->cursory*s->sx].d); - s->mem[s->cursorx+s->cursory*s->sx].style=attr; + strncpy(s->mem[s->cursorx+(size_t)s->cursory*s->sx].d,str,sizeof s->mem[s->cursorx+(size_t)s->cursory*s->sx].d); + s->mem[s->cursorx+(size_t)s->cursory*s->sx].style=attr; } else { char *ts=strdup(str); if (!ts) return; // nothing more to do - s->mem[s->cursorx+s->cursory*s->sx].p=ts; - s->mem[s->cursorx+s->cursory*s->sx].style=YAS_STORAGE|attr; + s->mem[s->cursorx+(size_t)s->cursory*s->sx].p=ts; + s->mem[s->cursorx+(size_t)s->cursory*s->sx].style=YAS_STORAGE|attr; } - s->mem[s->cursory*s->sx].style|=YAS_TOUCHED; + s->mem[(size_t)s->cursory*s->sx].style|=YAS_TOUCHED; s->cursorx++; for (i=1;i<width;i++) { if (s->cursorx<s->sx) { - yascreen_free_memcell(s,s->cursorx+s->cursory*s->sx); - *s->mem[s->cursorx+s->cursory*s->sx].d=0; - s->mem[s->cursorx+s->cursory*s->sx].style=attr; + yascreen_free_memcell(s,s->cursorx+(size_t)s->cursory*s->sx); + *s->mem[s->cursorx+(size_t)s->cursory*s->sx].d=0; + s->mem[s->cursorx+(size_t)s->cursory*s->sx].style=attr; } s->cursorx++; } @@ -764,10 +770,10 @@ int x; for (x=0;x<s->cursorx+width;x++) { // zap spanned chars - yascreen_free_memcell(s,x+s->cursory*s->sx); - strncpy(s->mem[x+s->cursory*s->sx].d,"<",sizeof s->mem[x+s->cursory*s->sx].d); - s->mem[x+s->cursory*s->sx].style=attr; - s->mem[s->cursory*s->sx].style|=YAS_TOUCHED; + yascreen_free_memcell(s,x+(size_t)s->cursory*s->sx); + strncpy(s->mem[x+(size_t)s->cursory*s->sx].d,"<",sizeof s->mem[x+(size_t)s->cursory*s->sx].d); + s->mem[x+(size_t)s->cursory*s->sx].style=attr; + s->mem[(size_t)s->cursory*s->sx].style|=YAS_TOUCHED; } s->cursorx+=width; return; @@ -784,10 +790,10 @@ s->cursorx--; - clen=strlen((s->mem[s->cursorx+s->cursory*s->sx].style&YAS_STORAGE)?s->mem[s->cursorx+s->cursory*s->sx].p:s->mem[s->cursorx+s->cursory*s->sx].d); + clen=strlen((s->mem[s->cursorx+(size_t)s->cursory*s->sx].style&YAS_STORAGE)?s->mem[s->cursorx+(size_t)s->cursory*s->sx].p:s->mem[s->cursorx+(size_t)s->cursory*s->sx].d); if (clen+strlen(str)<PSIZE) { // new fits, so current should fit too and don't have YAS_STORAGE - strncpy(s->mem[s->cursorx+s->cursory*s->sx].d+clen,str,sizeof s->mem[s->cursorx+s->cursory*s->sx].d-clen); - s->mem[s->cursorx+s->cursory*s->sx].style=attr; // as a side effect combining chars set attr for main char + strncpy(s->mem[s->cursorx+(size_t)s->cursory*s->sx].d+clen,str,sizeof s->mem[s->cursorx+(size_t)s->cursory*s->sx].d-clen); + s->mem[s->cursorx+(size_t)s->cursory*s->sx].style=attr; // as a side effect combining chars set attr for main char } else { size_t tslen=clen+strlen(str)+1; @@ -796,14 +802,14 @@ s->cursorx++; return; // nothing more we could do } - strcpy(ts,(s->mem[s->cursorx+s->cursory*s->sx].style&YAS_STORAGE)?s->mem[s->cursorx+s->cursory*s->sx].p:s->mem[s->cursorx+s->cursory*s->sx].d); + strcpy(ts,(s->mem[s->cursorx+(size_t)s->cursory*s->sx].style&YAS_STORAGE)?s->mem[s->cursorx+(size_t)s->cursory*s->sx].p:s->mem[s->cursorx+(size_t)s->cursory*s->sx].d); strcat(ts,str); - if (s->mem[s->cursorx+s->cursory*s->sx].style&YAS_STORAGE) - free(s->mem[s->cursorx+s->cursory*s->sx].p); - s->mem[s->cursorx+s->cursory*s->sx].p=ts; - s->mem[s->cursorx+s->cursory*s->sx].style=attr|YAS_STORAGE; + if (s->mem[s->cursorx+(size_t)s->cursory*s->sx].style&YAS_STORAGE) + free(s->mem[s->cursorx+(size_t)s->cursory*s->sx].p); + s->mem[s->cursorx+(size_t)s->cursory*s->sx].p=ts; + s->mem[s->cursorx+(size_t)s->cursory*s->sx].style=attr|YAS_STORAGE; } - s->mem[s->cursory*s->sx].style|=YAS_TOUCHED; + s->mem[(size_t)s->cursory*s->sx].style|=YAS_TOUCHED; s->cursorx++; } if (!width) // noop @@ -812,10 +818,10 @@ int x; for (x=s->cursorx;x<s->sx;x++) { // zap spanned chars - yascreen_free_memcell(s,x+s->cursory*s->sx); - strncpy(s->mem[x+s->cursory*s->sx].d,">",sizeof s->mem[x+s->cursory*s->sx].d); - s->mem[x+s->cursory*s->sx].style=attr; - s->mem[s->cursory*s->sx].style|=YAS_TOUCHED; + yascreen_free_memcell(s,x+(size_t)s->cursory*s->sx); + strncpy(s->mem[x+(size_t)s->cursory*s->sx].d,">",sizeof s->mem[x+(size_t)s->cursory*s->sx].d); + s->mem[x+(size_t)s->cursory*s->sx].style=attr; + s->mem[(size_t)s->cursory*s->sx].style|=YAS_TOUCHED; } s->cursorx+=width; return; @@ -1226,7 +1232,7 @@ for (j=0;j<s->sy;j++) for (i=0;i<s->sx;i++) - printf("x: %3d y: %3d len: %3zu attr: %08x s: %s\n",i,j,strlen((s->mem[i+s->sx*j].style&YAS_STORAGE)?s->mem[i+s->sx*j].p:s->mem[i+s->sx*j].d),s->mem[i+s->sx*j].style,(s->mem[i+s->sx*j].style&YAS_STORAGE)?s->mem[i+s->sx*j].p:s->mem[i+s->sx*j].d); + printf("x: %3d y: %3d len: %3zu attr: %08x s: %s\n",i,j,strlen((s->mem[i+(size_t)s->sx*j].style&YAS_STORAGE)?s->mem[i+(size_t)s->sx*j].p:s->mem[i+(size_t)s->sx*j].d),s->mem[i+(size_t)s->sx*j].style,(s->mem[i+(size_t)s->sx*j].style&YAS_STORAGE)?s->mem[i+(size_t)s->sx*j].p:s->mem[i+(size_t)s->sx*j].d); } // }}} inline void yascreen_redraw(yascreen *s) { // {{{ @@ -1687,13 +1693,13 @@ } // }}} inline void yascreen_clear_mem(yascreen *s,uint32_t attr) { // {{{ - int i; + size_t i; if (!s) return; attr&=~YAS_STORAGE; - for (i=0;i<s->sx*s->sy;i++) { + for (i=0;i<(size_t)s->sx*s->sy;i++) { if (s->mem[i].style&YAS_STORAGE) free(s->mem[i].p); s->mem[i].style=attr; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yascreen-2.06/yascreen.h new/yascreen-2.11/yascreen.h --- old/yascreen-2.06/yascreen.h 2025-01-15 17:05:45.000000000 +0100 +++ new/yascreen-2.11/yascreen.h 2026-03-14 23:18:52.000000000 +0100 @@ -1,6 +1,6 @@ -// $Id: yascreen.h,v 1.51 2025/01/15 15:57:59 bbonev Exp $ +// $Id: yascreen.h,v 1.52 2026/03/14 22:06:37 bbonev Exp $ // -// Copyright © 2015-2025 Boian Bonev ([email protected]) {{{ +// Copyright © 2015-2026 Boian Bonev ([email protected]) {{{ // // SPDX-License-Identifer: LGPL-3.0-or-later // diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yascreen-2.06/yascreen_feed.c new/yascreen-2.11/yascreen_feed.c --- old/yascreen-2.06/yascreen_feed.c 2025-01-15 17:05:45.000000000 +0100 +++ new/yascreen-2.11/yascreen_feed.c 2026-03-14 23:18:52.000000000 +0100 @@ -1,6 +1,6 @@ -// $Id: yascreen_feed.c,v 1.6 2025/01/15 15:57:59 bbonev Exp $ +// $Id: yascreen_feed.c,v 1.8 2026/03/14 22:06:37 bbonev Exp $ -// Copyright © 2015-2025 Boian Bonev ([email protected]) {{{ +// Copyright © 2015-2026 Boian Bonev ([email protected]) {{{ // // SPDX-License-Identifer: LGPL-3.0-or-later // @@ -377,7 +377,7 @@ } break; case ST_ESC_SQ_D: - if (s->ansipos>=sizeof s->ansibuf) { // buffer overrun, ignore the sequence + if (s->ansipos>=sizeof s->ansibuf-1) { // buffer overrun, ignore the sequence (keep 1 byte for NUL terminator) s->state=ST_NORM; break; } @@ -568,7 +568,7 @@ s->state=ST_NORM; break; case ST_ESC_ESC: - if (s->ansipos>=sizeof s->ansibuf) { // buffer overrun, ignore the sequence + if (s->ansipos>=sizeof s->ansibuf-1) { // buffer overrun, ignore the sequence (keep 1 byte for NUL terminator) s->state=ST_NORM; break; }
