mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix Pocketbook crashes when filename is nil (#8823)
Function `SetSubtaskInfo` takes only chars as a valid book. Since filename can be `nil` (not a char) the crash would happen. This Change avoids the crash by using a char type nil value. See: `int SetSubtaskInfo(int task, int subtask, const char *name, const char *book);` Fixes #8053 Fixes #8392 too Fixes #8743 last issue
This commit is contained in:
committed by
GitHub
parent
d2ee9d8d4e
commit
41e57fccd2
@@ -5,6 +5,7 @@ local C = ffi.C
|
||||
local inkview = ffi.load("inkview")
|
||||
local band = require("bit").band
|
||||
local util = require("util")
|
||||
local _ = require("gettext")
|
||||
|
||||
require("ffi/posix_h")
|
||||
require("ffi/linux_input_h")
|
||||
@@ -268,7 +269,7 @@ function PocketBook:notifyBookState(title, document)
|
||||
fo:write(fn)
|
||||
fo:close()
|
||||
end
|
||||
inkview.SetSubtaskInfo(inkview.GetCurrentTask(), 0, title and (title .. " - koreader") or "koreader", fn)
|
||||
inkview.SetSubtaskInfo(inkview.GetCurrentTask(), 0, title and (title .. " - koreader") or "koreader", fn or _("N/A"))
|
||||
end
|
||||
|
||||
function PocketBook:setDateTime(year, month, day, hour, min, sec)
|
||||
|
||||
Reference in New Issue
Block a user