From fa710cebbb94a5fce5802902bc1cc8d52367d190 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 13 Nov 2012 19:42:34 +0100 Subject: [PATCH] Find dialog: Don't crash when searching for a non-existant label. --- src/ui/gui/find-dialog.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ui/gui/find-dialog.c b/src/ui/gui/find-dialog.c index 0f856f9462..8dea41768a 100644 --- a/src/ui/gui/find-dialog.c +++ b/src/ui/gui/find-dialog.c @@ -471,8 +471,13 @@ string_label_compare (const struct comparator *cmptr, const struct string_comparator *ssc = (const struct string_comparator *) cmptr; + int width; + const char *text = var_lookup_value_label (cmptr->var, val); - int width = strlen (text); + if (text == NULL) + return false; + + width = strlen (text); assert ( cmptr->flags & STR_CMP_LABELS); -- 2.30.2