projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9070c45
)
stringsorter: Handle NULL strings
author
Benjamin Otte
<otte@redhat.com>
Sat, 27 May 2023 17:05:32 +0000
(19:05 +0200)
committer
Benjamin Otte
<otte@redhat.com>
Mon, 5 Jun 2023 03:33:07 +0000
(
05:33
+0200)
NULL is a valid string GValue, so we need to handle it.
The utf8 normalizing and collating functions do not, so we better catch
it early.
gtk/gtkstringsorter.c
patch
|
blob
|
history
diff --git
a/gtk/gtkstringsorter.c
b/gtk/gtkstringsorter.c
index 15866b930416cdfec45171cb0993711a97c02287..694e6318c513a8d891e2e325572a905cdba5fc95 100644
(file)
--- a/
gtk/gtkstringsorter.c
+++ b/
gtk/gtkstringsorter.c
@@
-77,6
+77,11
@@
gtk_string_sorter_get_key (GtkExpression *expression,
return NULL;
string = g_value_get_string (&value);
+ if (string == NULL)
+ {
+ g_value_unset (&value);
+ return NULL;
+ }
if (ignore_case)
s = g_utf8_casefold (string, -1);