mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-14 08:33:46 +01:00
fix page range check
In those cases, page is in the range [1...N], both ends included. Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
0e733af2a5
commit
2778868599
@ -249,7 +249,7 @@ handle_method_call(GDBusConnection* UNUSED(connection),
|
|||||||
g_variant_get(parameters, "(i)", &page);
|
g_variant_get(parameters, "(i)", &page);
|
||||||
|
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
if (page < 1 || (unsigned int)page >= number_of_pages) {
|
if (page < 1 || (unsigned int)page > number_of_pages) {
|
||||||
ret = false;
|
ret = false;
|
||||||
} else {
|
} else {
|
||||||
page_set(priv->zathura, page - 1);
|
page_set(priv->zathura, page - 1);
|
||||||
@ -264,7 +264,7 @@ handle_method_call(GDBusConnection* UNUSED(connection),
|
|||||||
g_variant_get(parameters, "(ia(dddd)a(idddd))", &page, &iter,
|
g_variant_get(parameters, "(ia(dddd)a(idddd))", &page, &iter,
|
||||||
&secondary_iter);
|
&secondary_iter);
|
||||||
|
|
||||||
if (page < 1 || (unsigned int)page >= number_of_pages) {
|
if (page < 1 || (unsigned int)page > number_of_pages) {
|
||||||
GVariant* result = g_variant_new("(b)", false);
|
GVariant* result = g_variant_new("(b)", false);
|
||||||
g_variant_iter_free(iter);
|
g_variant_iter_free(iter);
|
||||||
g_variant_iter_free(secondary_iter);
|
g_variant_iter_free(secondary_iter);
|
||||||
|
Loading…
Reference in New Issue
Block a user