[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Out of bounds check on pk_array* interface.
From: |
Jose E. Marchesi |
Subject: |
Re: [PATCH] Out of bounds check on pk_array* interface. |
Date: |
Thu, 02 Jul 2020 21:20:10 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>From 1e88413618a769803396dcc53a482f4620901341 Mon Sep 17 00:00:00 2001
From: kostasch <sdi1600195@di.uoa.gr>
Date: Thu, 2 Jul 2020 21:58:17 +0300
Subject: [PATCH 57/57] Compliance with GNU Standards
You forgot the ChangeLog in the commit message.
---
libpoke/pk-val.c | 28 ++++++++++------------------
1 file changed, 10 insertions(+), 18 deletions(-)
diff --git a/libpoke/pk-val.c b/libpoke/pk-val.c
index 12304332..3c333911 100644
--- a/libpoke/pk-val.c
+++ b/libpoke/pk-val.c
@@ -269,39 +269,31 @@ pk_array_nelem (pk_val array)
pk_val
pk_array_elem_val (pk_val array, uint64_t idx)
{
- if (idx >= pk_uint_value( pk_array_nelem (array))) {
+ if (idx < pk_uint_value (pk_array_nelem (array)))
+ return PVM_VAL_ARR_ELEM_VALUE (array, idx);
+ else
Please send a new patch against master, not an incremental patch with
the previous version of the patch.