From a071b531b0faee286497b5644e92bfaa1bdffd2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Fri, 9 Nov 2018 21:02:52 +0100 Subject: [PATCH] Version 18.14.1 --- swad_changelog.h | 3 ++- swad_mail.c | 13 +++++++++++-- swad_social.c | 20 +++++++++++++------- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 8b6ee8fca..135c48e1b 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -355,10 +355,11 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.14 (2018-11-09)" +#define Log_PLATFORM_VERSION "SWAD 18.14.1 (2018-11-09)" #define CSS_FILE "swad18.4.css" #define JS_FILE "swad17.17.1.js" /* + Version 18.14.1: Nov 09, 2018 Dixed several bugs when compiling with -Os. (236721 lines) Version 18.14: Nov 09, 2018 New module swad_form for forms to go to actions. Fixed bug in query to get assignments. (236705 lines) Version 18.13.7: Nov 09, 2018 Fixed bug in file browser links. (236552 lines) diff --git a/swad_mail.c b/swad_mail.c index 6d4c876ee..273506662 100644 --- a/swad_mail.c +++ b/swad_mail.c @@ -1811,7 +1811,7 @@ void Mai_ConfirmEmail (void) char MailKey[Mai_LENGTH_EMAIL_CONFIRM_KEY + 1]; long UsrCod; char Email[Cns_MAX_BYTES_EMAIL_ADDRESS + 1]; - bool KeyIsCorrect = false; + bool KeyIsCorrect; bool Confirmed; /***** Get parameter Key *****/ @@ -1834,6 +1834,12 @@ void Mai_ConfirmEmail (void) KeyIsCorrect = true; } + else + { + row = NULL; + UsrCod = -1L; + KeyIsCorrect = false; + } /***** Free structure that stores the query result *****/ DB_FreeMySQLResult (&mysql_res); @@ -1852,7 +1858,10 @@ void Mai_ConfirmEmail (void) " WHERE UsrCod=%ld AND E_mail='%s'", UsrCod,Email)) { - Confirmed = (row[0][0] == 'Y'); + Confirmed = false; + if (row) + if (row[0]) + Confirmed = (row[0][0] == 'Y'); /***** Confirm email *****/ if (Confirmed) diff --git a/swad_social.c b/swad_social.c index a199f61e3..15aeb23dc 100644 --- a/swad_social.c +++ b/swad_social.c @@ -772,7 +772,10 @@ static void Soc_BuildQueryToGetTimeline (char **Query, PubCod = Str_ConvertStrCodToLongCod (row[0]); } else + { + row = NULL; PubCod = -1L; + } /* Free structure that stores the query result */ DB_FreeMySQLResult (&mysql_res); @@ -785,13 +788,16 @@ static void Soc_BuildQueryToGetTimeline (char **Query, RangePubsToGet.Top = PubCod; // Narrow the range for the next iteration /* Get social note code (row[1]) */ - NotCod = Str_ConvertStrCodToLongCod (row[1]); - DB_QueryINSERT ("can not store note code", - "INSERT INTO not_codes SET NotCod=%ld", - NotCod); - DB_QueryINSERT ("can not store note code", - "INSERT INTO current_timeline SET NotCod=%ld", - NotCod); + if (row) + { + NotCod = Str_ConvertStrCodToLongCod (row[1]); + DB_QueryINSERT ("can not store note code", + "INSERT INTO not_codes SET NotCod=%ld", + NotCod); + DB_QueryINSERT ("can not store note code", + "INSERT INTO current_timeline SET NotCod=%ld", + NotCod); + } } else // Nothing got ==> abort loop break; // Last publishing