diff options
| author | Kim F. Storm | 2002-04-22 17:59:02 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2002-04-22 17:59:02 +0000 |
| commit | f25d60d646e84b783837351120087138529c9e95 (patch) | |
| tree | d631cecf91dcb78e9bf873b1004cb4528d25fe59 /src | |
| parent | 0347c911e909fbf5c1512067f9821d0476d8f9ee (diff) | |
| download | emacs-f25d60d646e84b783837351120087138529c9e95.tar.gz emacs-f25d60d646e84b783837351120087138529c9e95.zip | |
(remove_properties): Fixed trap for malformed plist.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/textprop.c | 13 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 8c6bd5af5ee..958b410cead 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2002-04-22 Kim F. Storm <storm@cua.dk> | ||
| 2 | |||
| 3 | * textprop.c (remove_properties): Fixed trap for malformed plist. | ||
| 4 | |||
| 1 | 2002-04-22 Richard M. Stallman <rms@gnu.org> | 5 | 2002-04-22 Richard M. Stallman <rms@gnu.org> |
| 2 | 6 | ||
| 3 | * window.c (make_window): Initialize height_fixed_p, | 7 | * window.c (make_window): Initialize height_fixed_p, |
diff --git a/src/textprop.c b/src/textprop.c index 928c9f9b8b3..c85b4dcfd04 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -452,15 +452,15 @@ remove_properties (plist, list, i, object) | |||
| 452 | register Lisp_Object tail1, tail2, sym, current_plist; | 452 | register Lisp_Object tail1, tail2, sym, current_plist; |
| 453 | register int changed = 0; | 453 | register int changed = 0; |
| 454 | 454 | ||
| 455 | /* Nonzero means tail1 is a list, otherwise it is a plist. */ | 455 | /* Nonzero means tail1 is a plist, otherwise it is a list. */ |
| 456 | int use_list; | 456 | int use_plist; |
| 457 | 457 | ||
| 458 | current_plist = i->plist; | 458 | current_plist = i->plist; |
| 459 | 459 | ||
| 460 | if (! NILP (plist)) | 460 | if (! NILP (plist)) |
| 461 | tail1 = plist, use_list = 0; | 461 | tail1 = plist, use_plist = 1; |
| 462 | else | 462 | else |
| 463 | tail1 = list, use_list = 1; | 463 | tail1 = list, use_plist = 0; |
| 464 | 464 | ||
| 465 | /* Go through each element of LIST or PLIST. */ | 465 | /* Go through each element of LIST or PLIST. */ |
| 466 | while (! NILP (tail1)) | 466 | while (! NILP (tail1)) |
| @@ -498,10 +498,9 @@ remove_properties (plist, list, i, object) | |||
| 498 | } | 498 | } |
| 499 | 499 | ||
| 500 | /* Advance thru TAIL1 one way or the other. */ | 500 | /* Advance thru TAIL1 one way or the other. */ |
| 501 | if (use_list) | 501 | tail1 = XCDR (tail1); |
| 502 | if (use_plist && CONSP (tail1)) | ||
| 502 | tail1 = XCDR (tail1); | 503 | tail1 = XCDR (tail1); |
| 503 | else | ||
| 504 | tail1 = XCDR (XCDR (tail1)); | ||
| 505 | } | 504 | } |
| 506 | 505 | ||
| 507 | if (changed) | 506 | if (changed) |