From c9ff5cfbfdf81f5ca547b97ea6d96f1b308e6f48 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Wed, 30 Mar 2016 12:43:57 -0700 Subject: [PATCH] Fixed a crash in compare_window_frames(). The function did not take into account the case when only one of of the pointers to the compared frames is NULL. --- sql/sql_window.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sql/sql_window.cc b/sql/sql_window.cc index c8e431e5bee..04fde8a854b 100644 --- a/sql/sql_window.cc +++ b/sql/sql_window.cc @@ -319,6 +319,12 @@ int compare_window_frames(Window_frame *win_frame1, if (win_frame1 == win_frame2) return 0; + if (!win_frame1) + return 2; + + if (!win_frame2) + return -2; + if (win_frame1->units != win_frame2->units) return win_frame1->units > win_frame2->units ? -2 : 2;