diff options
| author | Paul Eggert | 2011-06-16 10:25:16 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-06-16 10:25:16 -0700 |
| commit | 2e6813b0a503b14034783e12f704f7f70a47bae0 (patch) | |
| tree | b1b0cacb62d8c942352740dc36819060f5e5bc10 /src/editfns.c | |
| parent | 599a9e4f7cec752078570160fe5498fe5799863a (diff) | |
| download | emacs-2e6813b0a503b14034783e12f704f7f70a47bae0.tar.gz emacs-2e6813b0a503b14034783e12f704f7f70a47bae0.zip | |
* editfns.c (Finsert_char): Don't dump core with very negative counts.
Diffstat (limited to 'src/editfns.c')
| -rw-r--r-- | src/editfns.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/editfns.c b/src/editfns.c index dec0133951e..ab17eda86a9 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -2343,11 +2343,11 @@ from adjoining text, if those properties are sticky. */) | |||
| 2343 | len = CHAR_STRING (c, str); | 2343 | len = CHAR_STRING (c, str); |
| 2344 | else | 2344 | else |
| 2345 | str[0] = c, len = 1; | 2345 | str[0] = c, len = 1; |
| 2346 | if (XINT (count) <= 0) | ||
| 2347 | return Qnil; | ||
| 2346 | if (BUF_BYTES_MAX / len < XINT (count)) | 2348 | if (BUF_BYTES_MAX / len < XINT (count)) |
| 2347 | buffer_overflow (); | 2349 | buffer_overflow (); |
| 2348 | n = XINT (count) * len; | 2350 | n = XINT (count) * len; |
| 2349 | if (n <= 0) | ||
| 2350 | return Qnil; | ||
| 2351 | stringlen = min (n, 256 * len); | 2351 | stringlen = min (n, 256 * len); |
| 2352 | string = (char *) alloca (stringlen); | 2352 | string = (char *) alloca (stringlen); |
| 2353 | for (i = 0; i < stringlen; i++) | 2353 | for (i = 0; i < stringlen; i++) |