1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00
emacs/lib-src
Paul Eggert cffa5703b9 etags: remove some arbitrary limits
etags had undefined behavior if input files, lines, tags, etc.,
had more than INT_MAX bytes.  Clean up the usage of integer types
to fix the overflow errors I found.
* admin/merge-gnulib (GNULIB_MODULES): Add mempcpy.
* lib-src/etags.c: Include inttypes.h, intprops.h.
(memcpyz): New function.  Use it to simplify several occurrences
of memcpy followed by storing a trailing '\0'.
(xnew): Use xnmalloc, to catch overflow on integer multiplication.
(xrnew): Change last arg to multiplier.  The type is not needed.
All callers changed.
(node, lineno, charno, linecharno, invalidcharno, make_tag):
(pfnote, add_node, number_len, C_symtype, lbz, Makefile_targets)
(readline):
Use intmax_t for line numbers and character positions, instead of
int or long.
(linebuffer, make_tag, pfnote, total_size_of_entries, put_entry)
(in_word_set, C_symtype, token, cstack, pushclass_above):
(popclass_above, write_classname, consider_token, C_entries)
(Ruby_functions, Makefile_targets, Lua_functions, TeX_commands)
(TeX_decode_env, erlang_func, erlang_attribute, erlang_atom)
(substitute, regex_tag_multiline, nocase_tail, readline_interval)
(readline, savenstr, concat, etags_getcwd, relative_filename)
(linebuffer_setlen):
Use ptrdiff_t for object sizes, instead of int or long or unsigned
or size_t.
(write_classname, C_entries):
Avoid sprintf, as the result could exceed INT_MAX bytes
and then behavior goes haywire.
(main): Use int, instead of unsigned, for argv counts.
(get_language_from_filename): Use bool for boolean.
(Ruby_functions): Prefer strcpy to memcpy when copying "=".
(linebuffer_setlen): Use ‘if’ instead of ‘while’.
(memory_full, xnmalloc, xnrealloc): New functions.
(xmalloc): Use memory_full, and take a ptrdiff_t instead of a size_t.
(xrealloc): Remove; no longer needed.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/mempcpy.c, m4/mempcpy.m4: New files, copied from Gnulib.
2019-11-26 13:57:00 -08:00
..
ChangeLog.1 Update copyright year to 2019 2019-01-01 01:01:13 +00:00
COPYING Merge from Gnulib 2017-10-01 18:31:10 -07:00
ctags.c Port ctags+etags build to Sun C 5.12. 2014-05-18 11:57:04 -07:00
ebrowse.c Simplify lib-src version printing 2019-06-20 08:57:25 -07:00
emacsclient.c Revert "emacsclient: ignore --eval parameters when starting alternate editor" 2019-09-15 14:11:14 +02:00
etags.c etags: remove some arbitrary limits 2019-11-26 13:57:00 -08:00
hexl.c Update copyright year to 2019 2019-01-01 01:01:13 +00:00
make-docfile.c * lib-src/make-docfile.c: Fix comment typo. 2019-07-12 16:58:25 -07:00
make-fingerprint.c Update some URLs 2019-09-23 00:12:52 -07:00
Makefile.in Simplify lib-src version printing 2019-06-20 08:57:25 -07:00
movemail.c Merge from origin/emacs-26 2018-12-31 17:57:29 -08:00
ntlib.c Fix MS-Windows build broken by make-fingerprint changes 2019-04-15 17:17:01 +03:00
ntlib.h Update copyright year to 2019 2019-01-01 01:01:13 +00:00
pop.c Check instead of relying on NOTREACHED 2019-08-31 11:01:46 -07:00
pop.h Update author/maintainer info 2019-05-26 01:00:16 -07:00
rcs2log Update author/maintainer info 2019-05-26 01:00:16 -07:00
README changed Emacs' to GNU Emacs' 2006-03-31 07:25:44 +00:00
update-game-score.c Avoid some strlen work, primarily via strnlen 2019-06-25 14:55:08 -07:00

This directory contains the source code for the architecture-dependent
files that go in ${archlibdir}.  At present, these are mostly utility
programs used by GNU Emacs.