Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
ceeb3d7d
Commit
ceeb3d7d
authored
Apr 09, 2001
by
Eli Zaretskii
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(align): If the argument SIZE would overflow
__malloc_ptrdiff_t, fail right away.
parent
9f9a5e7a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
src/ChangeLog
src/ChangeLog
+5
-0
src/gmalloc.c
src/gmalloc.c
+8
-1
No files found.
src/ChangeLog
View file @
ceeb3d7d
2001-04-09 Eli Zaretskii <eliz@is.elta.co.il>
* gmalloc.c (align): If the argument SIZE would overflow
__malloc_ptrdiff_t, fail right away.
2001-04-06 Gerd Moellmann <gerd@gnu.org>
* xfns.c (compute_tip_xy): Add parameters WIDTH and HEIGHT.
...
...
src/gmalloc.c
View file @
ceeb3d7d
...
...
@@ -437,7 +437,14 @@ align (size)
__ptr_t
result
;
unsigned
long
int
adj
;
result
=
(
*
__morecore
)
(
size
);
/* align accepts an unsigned argument, but __morecore accepts a
signed one. This could lead to trouble if SIZE overflows a
signed int type accepted by __morecore. We just punt in that
case, since they are requesting a ludicrous amount anyway. */
if
((
__malloc_ptrdiff_t
)
size
<
0
)
result
=
0
;
else
result
=
(
*
__morecore
)
(
size
);
adj
=
(
unsigned
long
int
)
((
unsigned
long
int
)
((
char
*
)
result
-
(
char
*
)
NULL
))
%
BLOCKSIZE
;
if
(
adj
!=
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment