fix for bug #393952: crash when I try to VACUUM (StorageUnicodeFunctions::likeFunction() should handle null aArgv[0] and aArgv[1])

r=sdwilsh
This commit is contained in:
sspitzer%mozilla.org 2007-08-28 04:43:10 +00:00
Родитель 9dcc0bb9a1
Коммит b9976d5426
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -188,6 +188,9 @@ StorageUnicodeFunctions::likeFunction(sqlite3_context *p,
return; return;
} }
if (!sqlite3_value_text16(aArgv[0]) || !sqlite3_value_text16(aArgv[1]))
return;
nsDependentString A(static_cast<const PRUnichar *>(sqlite3_value_text16(aArgv[1]))); nsDependentString A(static_cast<const PRUnichar *>(sqlite3_value_text16(aArgv[1])));
nsDependentString B(static_cast<const PRUnichar *>(sqlite3_value_text16(aArgv[0]))); nsDependentString B(static_cast<const PRUnichar *>(sqlite3_value_text16(aArgv[0])));
NS_ASSERTION(!B.IsEmpty(), "LIKE string must not be null!"); NS_ASSERTION(!B.IsEmpty(), "LIKE string must not be null!");