diff options
author | wl <wl> | 2010-11-11 12:10:28 +0000 |
---|---|---|
committer | wl <wl> | 2010-11-11 12:10:28 +0000 |
commit | 1f2403275563c96b0ddf929c5f1991c3796719e5 (patch) | |
tree | abc04549b68ca22c1ef2c818428a26f0dabdc921 | |
parent | 62db6ccd5e467c9a4e82712c145d8a176211e44a (diff) | |
download | groff-1f2403275563c96b0ddf929c5f1991c3796719e5.tar.gz |
Fix crash in tbl with option `nospaces'.
Reported by Louis Guillaume <louis@zabrico.com>.
* src/libs/libgroff/string.cpp (string::remove_spaces): If input
data consists of spaces only and thus reduces to nothing, set `sz'
to 0.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | src/libs/libgroff/string.cpp | 3 |
2 files changed, 11 insertions, 1 deletions
@@ -1,3 +1,12 @@ +2010-11-11 Werner LEMBERG <wl@gnu.org> + + Fix crash in tbl with option `nospaces'. + Reported by Louis Guillaume <louis@zabrico.com>. + + * src/libs/libgroff/string.cpp (string::remove_spaces): If input + data consists of spaces only and thus reduces to nothing, set `sz' + to 0. + 2010-11-02 Ulrich Spörlein <uqs@spoerlein.net> [mdoc]: Complete previous patch and document OpenBSD releases. diff --git a/src/libs/libgroff/string.cpp b/src/libs/libgroff/string.cpp index 7ba24405..81763416 100644 --- a/src/libs/libgroff/string.cpp +++ b/src/libs/libgroff/string.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2009 +/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2009, 2010 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -318,6 +318,7 @@ void string::remove_spaces() if (ptr) { a_delete ptr; ptr = 0; + sz = 0; } } } |