aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.c
diff options
context:
space:
mode:
authorPaul Eggert2011-06-22 09:15:41 -0700
committerPaul Eggert2011-06-22 09:15:41 -0700
commit31fd4b3280acee4030efde84a0e23ae2b006ee31 (patch)
tree0b2245daf7e6f772cbaabf8916faeb34683bb390 /src/editfns.c
parentddb7ffeeb8ace6501eb453f50f0f9f6852eda21f (diff)
parent510005210ac9f4d813c4a2cc99b2c3c11e57c055 (diff)
downloademacs-31fd4b3280acee4030efde84a0e23ae2b006ee31.tar.gz
emacs-31fd4b3280acee4030efde84a0e23ae2b006ee31.zip
Merge: Integer overflow and signedness fixes (Bug#8873).
A few related buffer overrun fixes, too.
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 2d736bbc7e2..c0c0e530265 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -86,21 +86,7 @@ extern Lisp_Object w32_get_internal_run_time (void);
86 86
87static void time_overflow (void) NO_RETURN; 87static void time_overflow (void) NO_RETURN;
88static int tm_diff (struct tm *, struct tm *); 88static int tm_diff (struct tm *, struct tm *);
89static void find_field (Lisp_Object, Lisp_Object, Lisp_Object,
90 EMACS_INT *, Lisp_Object, EMACS_INT *);
91static void update_buffer_properties (EMACS_INT, EMACS_INT); 89static void update_buffer_properties (EMACS_INT, EMACS_INT);
92static Lisp_Object region_limit (int);
93static size_t emacs_nmemftime (char *, size_t, const char *,
94 size_t, const struct tm *, int, int);
95static void general_insert_function (void (*) (const char *, EMACS_INT),
96 void (*) (Lisp_Object, EMACS_INT,
97 EMACS_INT, EMACS_INT,
98 EMACS_INT, int),
99 int, ptrdiff_t, Lisp_Object *);
100static Lisp_Object subst_char_in_region_unwind (Lisp_Object);
101static Lisp_Object subst_char_in_region_unwind_1 (Lisp_Object);
102static void transpose_markers (EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT,
103 EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT);
104 90
105static Lisp_Object Qbuffer_access_fontify_functions; 91static Lisp_Object Qbuffer_access_fontify_functions;
106static Lisp_Object Fuser_full_name (Lisp_Object); 92static Lisp_Object Fuser_full_name (Lisp_Object);
@@ -345,13 +331,13 @@ If you set the marker not to point anywhere, the buffer will have no mark. */)
345 Return the number found, and store them in a vector in VEC 331 Return the number found, and store them in a vector in VEC
346 of length LEN. */ 332 of length LEN. */
347 333
348static int 334static ptrdiff_t
349overlays_around (EMACS_INT pos, Lisp_Object *vec, int len) 335overlays_around (EMACS_INT pos, Lisp_Object *vec, ptrdiff_t len)
350{ 336{
351 Lisp_Object overlay, start, end; 337 Lisp_Object overlay, start, end;
352 struct Lisp_Overlay *tail; 338 struct Lisp_Overlay *tail;
353 EMACS_INT startpos, endpos; 339 EMACS_INT startpos, endpos;
354 int idx = 0; 340 ptrdiff_t idx = 0;
355 341
356 for (tail = current_buffer->overlays_before; tail; tail = tail->next) 342 for (tail = current_buffer->overlays_before; tail; tail = tail->next)
357 { 343 {
@@ -419,7 +405,7 @@ get_pos_property (Lisp_Object position, register Lisp_Object prop, Lisp_Object o
419 else 405 else
420 { 406 {
421 EMACS_INT posn = XINT (position); 407 EMACS_INT posn = XINT (position);
422 int noverlays; 408 ptrdiff_t noverlays;
423 Lisp_Object *overlay_vec, tem; 409 Lisp_Object *overlay_vec, tem;
424 struct buffer *obuf = current_buffer; 410 struct buffer *obuf = current_buffer;
425 411