Hello community, here is the log from the commit of package libFS for openSUSE:Factory checked in at 2019-03-14 14:53:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libFS (Old) and /work/SRC/openSUSE:Factory/.libFS.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libFS" Thu Mar 14 14:53:18 2019 rev:13 rq:683900 version:1.0.8 Changes: -------- --- /work/SRC/openSUSE:Factory/libFS/libFS.changes 2015-05-06 07:47:31.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libFS.new.28833/libFS.changes 2019-03-14 14:53:24.687778688 +0100 @@ -1,0 +2,16 @@ +Mon Mar 11 13:43:18 UTC 2019 - Stefan Dirsch <[email protected]> + +- Update to version 1.0.8 + * autogen: add default patch prefix + * autogen.sh: use quoted string variables + * autogen.sh: use exec instead of waiting for configure to finish + * Fix sign comparison warning in loop index in FSListFontsWithXInfo + * Fix sign comparison warning in loop index in FSListCatalogues + * Fix sign comparison warning in loop indexes in FSQueryXBitmaps{8,16} + * Fix sign comparison warning in loop indexes in FSQueryXExtents{8,16} + * Fix sign comparison warning in loop index in FSQueryXInfo + * Don't try to send strings larger than protocol allows in requests + * Update configure.ac bug URL for gitlab migration + * Update README for gitlab migration + +------------------------------------------------------------------- Old: ---- libFS-1.0.7.tar.bz2 New: ---- libFS-1.0.8.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libFS.spec ++++++ --- /var/tmp/diff_new_pack.bfESFy/_old 2019-03-14 14:53:27.051778324 +0100 +++ /var/tmp/diff_new_pack.bfESFy/_new 2019-03-14 14:53:27.099778316 +0100 @@ -1,7 +1,7 @@ # # spec file for package libFS # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ Name: libFS %define lname libFS6 -Version: 1.0.7 +Version: 1.0.8 Release: 0 Summary: X Font Service client library License: MIT ++++++ libFS-1.0.7.tar.bz2 -> libFS-1.0.8.tar.bz2 ++++++ ++++ 27907 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libFS-1.0.7/ChangeLog new/libFS-1.0.8/ChangeLog --- old/libFS-1.0.7/ChangeLog 2015-05-01 06:34:25.000000000 +0200 +++ new/libFS-1.0.8/ChangeLog 2019-03-10 23:43:23.000000000 +0100 @@ -1,3 +1,149 @@ +commit 02de7390e58f00a3701f656a2b205dc6c8dafb58 +Author: Alan Coopersmith <[email protected]> +Date: Sun Mar 10 15:39:06 2019 -0700 + + libFS 1.0.8 + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit e8642e3203f9793c2cca19b2df334b4160c56742 +Author: Alan Coopersmith <[email protected]> +Date: Fri Dec 7 19:29:44 2018 -0800 + + Update configure.ac bug URL for gitlab migration + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 6052aa6479be8059c9294ced6e3a33e2316bb2d5 +Author: Alan Coopersmith <[email protected]> +Date: Sun Nov 18 21:46:25 2018 -0800 + + Update README for gitlab migration + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit d3af455fb236931fadb6e863e5a4ed509c61d868 +Author: Alan Coopersmith <[email protected]> +Date: Sun Sep 23 19:26:02 2018 -0700 + + Don't try to send strings larger than protocol allows in requests + + Also clears up all "Loss of precision on implicit conversion" warnings + from Oracle's Parfait static analyser. + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 12d64c65200930885c694d018ec66d8946b3a214 +Author: Alan Coopersmith <[email protected]> +Date: Sun Sep 23 13:51:25 2018 -0700 + + Fix sign comparison warning in loop index in FSQueryXInfo + + FSQXInfo.c: In function ‘FSQueryXInfo’: + FSQXInfo.c:110:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] + for (j=0; j<props->num_offsets; j++) + ^ + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 3eb9c6bbfb4e6caf6efb5dec8744f257c2d63be7 +Author: Alan Coopersmith <[email protected]> +Date: Sun Sep 23 13:47:35 2018 -0700 + + Fix sign comparison warning in loop indexes in FSQueryXExtents{8,16} + + FSQXExt.c: In function ‘FSQueryXExtents8’: + FSQXExt.c:105:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] + for (i = 0; i < reply.num_extents; i++) { + ^ + FSQXExt.c: In function ‘FSQueryXExtents16’: + FSQXExt.c:141:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] + for (i = 0; i < str_len; i++) { + ^ + FSQXExt.c:165:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] + for (i = 0; i < reply.num_extents; i++) { + ^ + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 8213b7070c039ea16d0112eff01cc7420031c089 +Author: Alan Coopersmith <[email protected]> +Date: Sun Sep 23 13:44:59 2018 -0700 + + Fix sign comparison warning in loop indexes in FSQueryXBitmaps{8,16} + + FSQGlyphs.c: In function ‘FSQueryXBitmaps8’: + FSQGlyphs.c:113:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] + for (i=0; i<reply.num_chars; i++) + ^ + FSQGlyphs.c: In function ‘FSQueryXBitmaps16’: + FSQGlyphs.c:160:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] + for (i = 0; i < str_len; i++) { + ^ + FSQGlyphs.c:198:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] + for (i=0; i<reply.num_chars; i++) + ^ + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit caee4c2bf188484f117e5bd866e3b56c8506593e +Author: Alan Coopersmith <[email protected]> +Date: Sun Sep 23 13:40:30 2018 -0700 + + Fix sign comparison warning in loop index in FSListCatalogues + + FSListCats.c: In function ‘FSListCatalogues’: + FSListCats.c:104:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] + for (i = 0; i < rep.num_catalogues; i++) { + ^ + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit b37bbeb7ca931b0f5170e877b0bbfd0959d344b7 +Author: Alan Coopersmith <[email protected]> +Date: Sun Sep 23 13:34:04 2018 -0700 + + Fix sign comparison warning in loop index in FSListFontsWithXInfo + + FSFontInfo.c: In function ‘FSListFontsWithXInfo’: + FSFontInfo.c:182:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] + for (j=0; j<pi[i]->num_offsets; j++) + ^ + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit fed3794a5204eace3926f13573b10f0b51f85fbc +Author: Mihail Konev <[email protected]> +Date: Thu Jan 26 13:52:49 2017 +1000 + + autogen: add default patch prefix + + Signed-off-by: Mihail Konev <[email protected]> + +commit 89f456580ea831652f119158f8b257dfd531a7e1 +Author: Emil Velikov <[email protected]> +Date: Mon Mar 9 12:00:52 2015 +0000 + + autogen.sh: use quoted string variables + + Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent + fall-outs, when they contain space. + + Signed-off-by: Emil Velikov <[email protected]> + Reviewed-by: Peter Hutterer <[email protected]> + Signed-off-by: Peter Hutterer <[email protected]> + +commit 4ef3748251ac2139b73b137dcef529421447652b +Author: Peter Hutterer <[email protected]> +Date: Tue Jan 24 10:32:07 2017 +1000 + + autogen.sh: use exec instead of waiting for configure to finish + + Syncs the invocation of configure with the one from the server. + + Signed-off-by: Peter Hutterer <[email protected]> + Reviewed-by: Emil Velikov <[email protected]> + commit a9db12661e7412dd935706c92db6d7bc46238782 Author: Alan Coopersmith <[email protected]> Date: Thu Apr 30 21:14:46 2015 -0700 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libFS-1.0.7/Makefile.am new/libFS-1.0.8/Makefile.am --- old/libFS-1.0.7/Makefile.am 2015-05-01 06:33:13.000000000 +0200 +++ new/libFS-1.0.8/Makefile.am 2019-03-10 23:43:04.000000000 +0100 @@ -42,3 +42,5 @@ lint: (cd src && $(MAKE) $(MFLAGS) lint) endif LINT + +EXTRA_DIST = README.md diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libFS-1.0.7/README new/libFS-1.0.8/README --- old/libFS-1.0.7/README 2015-05-01 06:33:13.000000000 +0200 +++ new/libFS-1.0.8/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,28 +0,0 @@ -libFS - X Font Service client library - -This library is used by clients of X Font Servers (xfs), such as -xfsinfo, fslsfonts, and the X servers themselves. - -All questions regarding this software should be directed at the -Xorg mailing list: - - http://lists.freedesktop.org/mailman/listinfo/xorg - -Please submit bug reports to the Xorg bugzilla: - - https://bugs.freedesktop.org/enter_bug.cgi?product=xorg - -The master development code repository can be found at: - - git://anongit.freedesktop.org/git/xorg/lib/libFS - - http://cgit.freedesktop.org/xorg/lib/libFS - -For patch submission instructions, see: - - http://www.x.org/wiki/Development/Documentation/SubmittingPatches - -For more information on the git code manager, see: - - http://wiki.x.org/wiki/GitPage - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libFS-1.0.7/README.md new/libFS-1.0.8/README.md --- old/libFS-1.0.7/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/libFS-1.0.8/README.md 2019-03-10 23:43:04.000000000 +0100 @@ -0,0 +1,21 @@ +libFS - X Font Service client library +------------------------------------- + +This library is used by clients of X Font Servers (xfs), such as +xfsinfo, fslsfonts, and the X servers themselves. + +All questions regarding this software should be directed at the +Xorg mailing list: + + https://lists.x.org/mailman/listinfo/xorg + +The master development code repository can be found at: + + https://gitlab.freedesktop.org/xorg/lib/libFS + +Please submit bug reports and requests to merge patches there. + +For patch submission instructions, see: + + https://www.x.org/wiki/Development/Documentation/SubmittingPatches + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libFS-1.0.7/config.h.in new/libFS-1.0.8/config.h.in --- old/libFS-1.0.7/config.h.in 2015-05-01 06:33:25.000000000 +0200 +++ new/libFS-1.0.8/config.h.in 2019-03-10 23:43:14.000000000 +0100 @@ -24,6 +24,9 @@ /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + /* Define to 1 if you have the <strings.h> header file. */ #undef HAVE_STRINGS_H @@ -33,6 +36,9 @@ /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY +/* Define to 1 if you have the `strnlen' function. */ +#undef HAVE_STRNLEN + /* Define to 1 if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H @@ -48,8 +54,7 @@ /* Support os-specific local connections */ #undef LOCALCONN -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ +/* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libFS-1.0.7/configure.ac new/libFS-1.0.8/configure.ac --- old/libFS-1.0.7/configure.ac 2015-05-01 06:33:13.000000000 +0200 +++ new/libFS-1.0.8/configure.ac 2019-03-10 23:43:04.000000000 +0100 @@ -22,8 +22,8 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([libFS], [1.0.7], - [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libFS]) +AC_INIT([libFS], [1.0.8], + [https://gitlab.freedesktop.org/xorg/lib/libFS/issues], [libFS]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) @@ -52,7 +52,7 @@ XTRANS_CONNECTION_FLAGS # Checks for library functions. -AC_CHECK_FUNCS([strlcpy]) +AC_CHECK_FUNCS([strlcpy strnlen]) # Allow checking code with lint, sparse, etc. XORG_WITH_LINT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libFS-1.0.7/src/FSFontInfo.c new/libFS-1.0.8/src/FSFontInfo.c --- old/libFS-1.0.7/src/FSFontInfo.c 2015-05-01 06:33:13.000000000 +0200 +++ new/libFS-1.0.8/src/FSFontInfo.c 2019-03-10 23:43:04.000000000 +0100 @@ -64,9 +64,7 @@ FSPropOffset ***offsets, unsigned char ***prop_data) { - long nbytes; - int i, - j; + int i; size_t size = 0; FSXFontInfoHeader **fhdr = (FSXFontInfoHeader **) NULL; FSPropInfo **pi = (FSPropInfo **) NULL; @@ -81,10 +79,24 @@ Bool eat_data = True; GetReq(ListFontsWithXInfo, req); - req->maxNames = maxNames; - nbytes = req->nbytes = pattern ? strlen(pattern) : 0; - req->length += (nbytes + 3) >> 2; - _FSSend(svr, pattern, nbytes); + req->maxNames = (CARD32) maxNames; + req->nbytes = 0; + if (pattern != NULL) { + size_t nbytes; + +#ifdef HAVE_STRNLEN + nbytes = strnlen(pattern, FSMaxRequestBytes(svr)); +#else + nbytes = strlen(pattern); +#endif + + if (nbytes <= (FSMaxRequestBytes(svr) - + SIZEOF(fsListFontsWithXInfoReq))) { + req->nbytes = (CARD16) nbytes; + req->length += (CARD16) ((nbytes + 3) >> 2); + _FSSend(svr, pattern, (long) nbytes); + } + } for (i = 0;; i++) { if (FSProtocolVersion(svr) > 1) @@ -179,7 +191,7 @@ if (!pd[i]) goto cleanpo; /* get offsets */ - for (j=0; j<pi[i]->num_offsets; j++) + for (unsigned int j = 0; j < pi[i]->num_offsets; j++) { _FSReadPad(svr, (char *) &local_po, SIZEOF(fsPropOffset)); po[i][j].name.position = local_po.name.position; @@ -197,6 +209,8 @@ if (FSProtocolVersion(svr) != 1) { + unsigned long nbytes; + /* get the name */ _FSRead(svr, flist[i], (long) reply.nameLength); flist[i][reply.nameLength] = '\0'; @@ -230,7 +244,7 @@ FSfree(fhdr[i]); /* Error cleanup for all previously filled in items in the arrays */ badmem: - for (j = (i - 1); j >= 0; j--) { + for (int j = (i - 1); j >= 0; j--) { FSfree(pi[j]); FSfree(po[j]); FSfree(pd[j]); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libFS-1.0.7/src/FSFtNames.c new/libFS-1.0.8/src/FSFtNames.c --- old/libFS-1.0.7/src/FSFtNames.c 2015-05-01 06:33:13.000000000 +0200 +++ new/libFS-1.0.8/src/FSFtNames.c 2019-03-10 23:43:04.000000000 +0100 @@ -61,7 +61,6 @@ int maxNames, int *actualCount) { - long nbytes; unsigned int i, length; char **flist; @@ -71,10 +70,24 @@ unsigned long rlen; GetReq(ListFonts, req); - req->maxNames = maxNames; - nbytes = req->nbytes = pattern ? strlen(pattern) : 0; - req->length += (nbytes + 3) >> 2; - _FSSend(svr, pattern, nbytes); + req->maxNames = (CARD32) maxNames; + req->nbytes = 0; + if (pattern != NULL) { + size_t nbytes; + +#ifdef HAVE_STRNLEN + nbytes = strnlen(pattern, FSMaxRequestBytes(svr)); +#else + nbytes = strlen(pattern); +#endif + + if (nbytes <= (FSMaxRequestBytes(svr) - SIZEOF(fsListFontsReq))) { + req->nbytes = (CARD16) nbytes; + req->length += (CARD16) ((nbytes + 3) >> 2); + _FSSend(svr, pattern, (long) nbytes); + } + } + if (!_FSReply(svr, (fsReply *) & rep, (SIZEOF(fsListFontsReply) - SIZEOF(fsGenericReply)) >> 2, fsFalse)) return (char **) NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libFS-1.0.7/src/FSListCats.c new/libFS-1.0.8/src/FSListCats.c --- old/libFS-1.0.7/src/FSListCats.c 2015-05-01 06:33:13.000000000 +0200 +++ new/libFS-1.0.8/src/FSListCats.c 2019-03-10 23:43:04.000000000 +0100 @@ -61,9 +61,7 @@ int maxNames, int *actualCount) { - long nbytes; - int i, - length; + int length; char **clist; char *c; fsListCataloguesReply rep; @@ -71,10 +69,24 @@ unsigned long rlen; GetReq(ListCatalogues, req); - req->maxNames = maxNames; - nbytes = req->nbytes = pattern ? strlen(pattern) : 0; - req->length += (nbytes + 3) >> 2; - _FSSend(svr, pattern, nbytes); + req->maxNames = (CARD32) maxNames; + req->nbytes = 0; + if (pattern != NULL) { + size_t nbytes; + +#ifdef HAVE_STRNLEN + nbytes = strnlen(pattern, FSMaxRequestBytes(svr)); +#else + nbytes = strlen(pattern); +#endif + + if (nbytes <= (FSMaxRequestBytes(svr) - SIZEOF(fsListCataloguesReq))) { + req->nbytes = (CARD16) nbytes; + req->length += (CARD16) ((nbytes + 3) >> 2); + _FSSend(svr, pattern, (long) nbytes); + } + } + if (!_FSReply(svr, (fsReply *) & rep, (SIZEOF(fsListCataloguesReply) - SIZEOF(fsGenericReply)) >> 2, fsFalse)) return (char **) NULL; @@ -101,7 +113,7 @@ _FSReadPad(svr, c, (long) rlen); /* unpack */ length = *c; - for (i = 0; i < rep.num_catalogues; i++) { + for (CARD32 i = 0; i < rep.num_catalogues; i++) { clist[i] = c + 1; c += length + 1; length = *c; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libFS-1.0.7/src/FSOpenFont.c new/libFS-1.0.8/src/FSOpenFont.c --- old/libFS-1.0.7/src/FSOpenFont.c 2015-05-01 06:33:13.000000000 +0200 +++ new/libFS-1.0.8/src/FSOpenFont.c 2019-03-10 23:43:04.000000000 +0100 @@ -62,22 +62,29 @@ const char *name, Font *otherid) { - unsigned int nbytes; + size_t nbytes; fsOpenBitmapFontReq *req; fsOpenBitmapFontReply reply; Font fid; char buf[256]; - nbytes = name ? strlen(name) : 0; - if (nbytes > 255) return 0; +#ifdef HAVE_STRNLEN + nbytes = strnlen(name, 256); +#else + nbytes = strlen(name); +#endif + + if ((nbytes == 0) || (nbytes > 255) || + (nbytes > (FSMaxRequestBytes(svr) - SIZEOF(fsOpenBitmapFontReq)))) + return 0; GetReq(OpenBitmapFont, req); - buf[0] = nbytes; + buf[0] = (CARD8) nbytes; memcpy(&buf[1], name, nbytes); nbytes++; req->fid = fid = svr->resource_id++; req->format_hint = hint; req->format_mask = fmask; - req->length += (nbytes + 3) >> 2; + req->length += (CARD16) ((nbytes + 3) >> 2); _FSSend(svr, buf, (long) nbytes); if (!_FSReply(svr, (fsReply *) & reply, (SIZEOF(fsOpenBitmapFontReply)-SIZEOF(fsGenericReply)) >> 2, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libFS-1.0.7/src/FSQGlyphs.c new/libFS-1.0.8/src/FSQGlyphs.c --- old/libFS-1.0.7/src/FSQGlyphs.c 2015-05-01 06:33:13.000000000 +0200 +++ new/libFS-1.0.8/src/FSQGlyphs.c 2019-03-10 23:43:04.000000000 +0100 @@ -71,14 +71,16 @@ fsOffset32 local_offs; unsigned char *gd; int left; - int i; + + if (str_len > (FSMaxRequestBytes(svr) - SIZEOF(fsQueryXBitmaps8Req))) + return FSBadLength; GetReq(QueryXBitmaps8, req); req->fid = fid; - req->range = range_type; + req->range = (BOOL) range_type; req->format = format; - req->num_ranges = str_len; - req->length += (str_len + 3) >> 2; + req->num_ranges = (CARD32) str_len; + req->length += (CARD16) ((str_len + 3) >> 2); _FSSend(svr, (char *) str, str_len); /* get back the info */ @@ -110,7 +112,7 @@ FSfree(offs); return FSBadAlloc; } - for (i=0; i<reply.num_chars; i++) + for (CARD32 i = 0; i < reply.num_chars; i++) { _FSReadPad(svr, (char *) &local_offs, (SIZEOF(fsOffset32))); offs->position = local_offs.position; @@ -140,14 +142,18 @@ fsOffset32 local_offs; unsigned char *gd; int left; - int i; + + /* Relies on fsChar2b & fsChar2b_version1 being the same size */ + if (str_len > ((FSMaxRequestBytes(svr) - SIZEOF(fsQueryXBitmaps16Req)) + / SIZEOF(fsChar2b))) + return FSBadLength; GetReq(QueryXBitmaps16, req); req->fid = fid; - req->range = range_type; + req->range = (BOOL) range_type; req->format = format; - req->num_ranges = str_len; - req->length += ((str_len * SIZEOF(fsChar2b)) + 3) >> 2; + req->num_ranges = (CARD32) str_len; + req->length += (CARD16) (((str_len * SIZEOF(fsChar2b)) + 3) >> 2); if (FSProtocolVersion(svr) == 1) { fsChar2b_version1 *swapped_str; @@ -157,7 +163,7 @@ swapped_str = FSmalloc(SIZEOF(fsChar2b_version1) * str_len); if (!swapped_str) return FSBadAlloc; - for (i = 0; i < str_len; i++) { + for (unsigned long i = 0; i < str_len; i++) { swapped_str[i].low = str[i].low; swapped_str[i].high = str[i].high; } @@ -195,7 +201,7 @@ FSfree(offs); return FSBadAlloc; } - for (i=0; i<reply.num_chars; i++) + for (CARD32 i = 0; i < reply.num_chars; i++) { _FSReadPad(svr, (char *) &local_offs, (SIZEOF(fsOffset32))); offs->position = local_offs.position; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libFS-1.0.7/src/FSQXExt.c new/libFS-1.0.8/src/FSQXExt.c --- old/libFS-1.0.7/src/FSQXExt.c 2015-05-01 06:33:13.000000000 +0200 +++ new/libFS-1.0.8/src/FSQXExt.c 2019-03-10 23:43:04.000000000 +0100 @@ -78,13 +78,15 @@ fsQueryXExtents8Reply reply; FSXCharInfo *ext; fsXCharInfo local_exts; - int i; + + if (str_len > (FSMaxRequestBytes(svr) - SIZEOF(fsQueryXExtents8Req))) + return FSBadLength; GetReq(QueryXExtents8, req); req->fid = fid; - req->range = range_type; - req->num_ranges = str_len; - req->length += (str_len + 3) >> 2; + req->range = (BOOL) range_type; + req->num_ranges = (CARD32) str_len; + req->length += (CARD16) ((str_len + 3) >> 2); _FSSend(svr, (char *) str, str_len); /* get back the info */ @@ -102,7 +104,7 @@ *extents = ext; if (!ext) return FSBadAlloc; - for (i = 0; i < reply.num_extents; i++) { + for (CARD32 i = 0; i < reply.num_extents; i++) { _FSReadPad(svr, (char *) &local_exts, SIZEOF(fsXCharInfo)); _FS_convert_char_info(&local_exts, &ext[i]); } @@ -124,13 +126,17 @@ fsQueryXExtents16Reply reply; FSXCharInfo *ext; fsXCharInfo local_exts; - int i; + + /* Relies on fsChar2b & fsChar2b_version1 being the same size */ + if (str_len > ((FSMaxRequestBytes(svr) - SIZEOF(fsQueryXExtents16Req)) + / SIZEOF(fsChar2b))) + return FSBadLength; GetReq(QueryXExtents16, req); req->fid = fid; - req->range = range_type; - req->num_ranges = str_len; - req->length += ((str_len * SIZEOF(fsChar2b)) + 3) >> 2; + req->range = (BOOL) range_type; + req->num_ranges = (CARD32) str_len; + req->length += (CARD16) (((str_len * SIZEOF(fsChar2b)) + 3) >> 2); if (FSProtocolVersion(svr) == 1) { fsChar2b_version1 *swapped_str; @@ -138,7 +144,7 @@ swapped_str = FSmalloc(SIZEOF(fsChar2b_version1) * str_len); if (!swapped_str) return FSBadAlloc; - for (i = 0; i < str_len; i++) { + for (unsigned long i = 0; i < str_len; i++) { swapped_str[i].low = str[i].low; swapped_str[i].high = str[i].high; } @@ -162,7 +168,7 @@ *extents = ext; if (!ext) return FSBadAlloc; - for (i = 0; i < reply.num_extents; i++) { + for (CARD32 i = 0; i < reply.num_extents; i++) { _FSReadPad(svr, (char *) &local_exts, SIZEOF(fsXCharInfo)); _FS_convert_char_info(&local_exts, &ext[i]); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libFS-1.0.7/src/FSQXInfo.c new/libFS-1.0.8/src/FSQXInfo.c --- old/libFS-1.0.7/src/FSQXInfo.c 2015-05-01 06:33:13.000000000 +0200 +++ new/libFS-1.0.8/src/FSQXInfo.c 2019-03-10 23:43:04.000000000 +0100 @@ -74,7 +74,6 @@ unsigned char *pdata; fsPropInfo local_pi; fsPropOffset local_po; - int j; GetReq(QueryXInfo, req); req->id = fid; @@ -107,7 +106,7 @@ return FSBadAlloc; } /* get offsets */ - for (j=0; j<props->num_offsets; j++) + for (unsigned int j = 0; j < props->num_offsets; j++) { _FSReadPad(svr, (char *) &local_po, SIZEOF(fsPropOffset)); offset_data[j].name.position = local_po.name.position; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libFS-1.0.7/src/FSQuExt.c new/libFS-1.0.8/src/FSQuExt.c --- old/libFS-1.0.7/src/FSQuExt.c 2015-05-01 06:33:13.000000000 +0200 +++ new/libFS-1.0.8/src/FSQuExt.c 2019-03-10 23:43:04.000000000 +0100 @@ -64,9 +64,20 @@ { fsQueryExtensionReply rep; fsQueryExtensionReq *req; + size_t namelen; + +#ifdef HAVE_STRNLEN + namelen = name ? strnlen(name, 256) : 0; +#else + namelen = name ? strlen(name) : 0; +#endif + + if ((namelen == 0) || (namelen > 255) || + (namelen > (FSMaxRequestBytes(svr) - SIZEOF(fsQueryExtensionReq)))) + return False; GetReq(QueryExtension, req); - req->nbytes = name ? strlen(name) : 0; + req->nbytes = (CARD8) namelen; req->length += (req->nbytes + 3) >> 2; _FSSend(svr, name, (long) req->nbytes); if (!_FSReply(svr, (fsReply *) & rep, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libFS-1.0.7/src/FSSetCats.c new/libFS-1.0.8/src/FSSetCats.c --- old/libFS-1.0.7/src/FSSetCats.c 2015-05-01 06:33:13.000000000 +0200 +++ new/libFS-1.0.8/src/FSSetCats.c 2019-03-10 23:43:04.000000000 +0100 @@ -60,27 +60,44 @@ int num, char **cats) { - int nbytes; fsSetCataloguesReq *req; char buf[256]; - int i; - int len, tlen, tnum; + int i, tnum; + size_t len; for (i = 0, tnum = 0, len = 0; i < num; i++) { - if ((tlen = strlen(cats[i])) < 256) { + size_t tlen; + +#ifdef HAVE_STRNLEN + tlen = strnlen(cats[i], 256); +#else + tlen = strlen(cats[i]); +#endif + if (tlen < 256) { len += tlen; tnum++; } } + if ((tnum > 255) || + (len > (FSMaxRequestBytes(svr) - SIZEOF(fsSetCataloguesReq)))) + return FSBadLength; + GetReq(SetCatalogues, req); - req->num_catalogues = tnum; - req->length += (len + 3) >> 2; + req->num_catalogues = (CARD8) tnum; + req->length += (CARD16) ((len + 3) >> 2); for (i = 0; i < num; i++) { + size_t nbytes; + +#ifdef HAVE_STRNLEN + nbytes = strnlen(cats[i], 256); +#else nbytes = strlen(cats[i]); +#endif + if (nbytes < 256) { - buf[0] = nbytes; + buf[0] = (CARD8) nbytes; memcpy(&buf[1], cats[i], nbytes); nbytes++; _FSSend(svr, buf, (long) nbytes); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libFS-1.0.7/src/FSlibint.h new/libFS-1.0.8/src/FSlibint.h --- old/libFS-1.0.7/src/FSlibint.h 2015-05-01 06:33:13.000000000 +0200 +++ new/libFS-1.0.8/src/FSlibint.h 2019-03-10 23:43:04.000000000 +0100 @@ -110,6 +110,9 @@ #define FSlibServerClosing (1L << 1) +/* FSMaxRequestBytes - returns FSMaxRequestSize converted to bytes */ +#define FSMaxRequestBytes(svr) ((svr)->max_request_size << 2) + /* * GetReq - Get the next available FS request packet in the buffer and * return it.
