From 1f2403275563c96b0ddf929c5f1991c3796719e5 Mon Sep 17 00:00:00 2001 From: wl Date: Thu, 11 Nov 2010 12:10:28 +0000 Subject: Fix crash in tbl with option `nospaces'. Reported by Louis Guillaume . * src/libs/libgroff/string.cpp (string::remove_spaces): If input data consists of spaces only and thus reduces to nothing, set `sz' to 0. --- ChangeLog | 9 +++++++++ src/libs/libgroff/string.cpp | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 58fe7d6f..29efe4a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-11-11 Werner LEMBERG + + Fix crash in tbl with option `nospaces'. + Reported by Louis Guillaume . + + * 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 [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; } } } -- cgit v1.2.1