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
c78baabf
Commit
c78baabf
authored
Jun 08, 2011
by
Paul Eggert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
parent
c9d624c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
src/ChangeLog
src/ChangeLog
+3
-0
src/alloc.c
src/alloc.c
+1
-4
No files found.
src/ChangeLog
View file @
c78baabf
2011-06-08 Paul Eggert <eggert@cs.ucla.edu>
* alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
* alloc.c: Catch some string size overflows that we were missing.
(XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
for convenience in STRING_BYTES_MAX.
...
...
@@ -10,6 +12,7 @@
size_t overflow on (unusual) hosts where SIZE_MAX <= min
(PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
and ptrdiff_t and EMACS_INT are both 64 bits.
* character.c, coding.c, doprnt.c, editfns.c, eval.c:
All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
* lisp.h (STRING_BYTES_BOUND): Renamed from STRING_BYTES_MAX.
...
...
src/alloc.c
View file @
c78baabf
...
...
@@ -2246,7 +2246,6 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */)
{
register
Lisp_Object
val
;
struct
Lisp_Bool_Vector
*
p
;
int
real_init
,
i
;
EMACS_INT
length_in_chars
,
length_in_elts
;
int
bits_per_value
;
...
...
@@ -2268,9 +2267,7 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */)
p
=
XBOOL_VECTOR
(
val
);
p
->
size
=
XFASTINT
(
length
);
real_init
=
(
NILP
(
init
)
?
0
:
-
1
);
for
(
i
=
0
;
i
<
length_in_chars
;
i
++
)
p
->
data
[
i
]
=
real_init
;
memset
(
p
->
data
,
NILP
(
init
)
?
0
:
-
1
,
length_in_chars
);
/* Clear the extraneous bits in the last byte. */
if
(
XINT
(
length
)
!=
length_in_chars
*
BOOL_VECTOR_BITS_PER_CHAR
)
...
...
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