[yap] Complete fix for accessing yap_flags array

Petr Pisar ppisar at fedoraproject.org
Mon Jan 7 17:14:00 UTC 2013


commit d282bdccd8b2785dc882e7fc1c1bc1541d261caf
Author: Petr Písař <ppisar at redhat.com>
Date:   Mon Jan 7 18:07:53 2013 +0100

    Complete fix for accessing yap_flags array

 ...-by-one-error-when-initializing-yap_flags.patch |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/yap-6.2.2-Off-by-one-error-when-initializing-yap_flags.patch b/yap-6.2.2-Off-by-one-error-when-initializing-yap_flags.patch
index e0b59a5..a376743 100644
--- a/yap-6.2.2-Off-by-one-error-when-initializing-yap_flags.patch
+++ b/yap-6.2.2-Off-by-one-error-when-initializing-yap_flags.patch
@@ -1,4 +1,4 @@
-From 1fba7f121d0f3e93faa94be4dbeba383176717f6 Mon Sep 17 00:00:00 2001
+From fa8f0f7b2d107770ae4d37bc77c902eafc59c86c Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
 Date: Mon, 7 Jan 2013 17:31:08 +0100
 Subject: [PATCH] Off-by-one error when initializing yap_flags
@@ -6,8 +6,9 @@ Subject: [PATCH] Off-by-one error when initializing yap_flags
 The yap_flags_field of all_heap_codes structure is of type
 Int[LAST_FLAG], thus the loop should iterate from 0 to LAST_FLAG - 1.
 ---
- C/init.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ C/init.c     | 2 +-
+ C/stdpreds.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/C/init.c b/C/init.c
 index dda09cc..8f01864 100755
@@ -22,6 +23,19 @@ index dda09cc..8f01864 100755
      yap_flags[i] = 0;
    }
  #ifdef MPW
+diff --git a/C/stdpreds.c b/C/stdpreds.c
+index a4c0e86..8a4183f 100755
+--- a/C/stdpreds.c
++++ b/C/stdpreds.c
+@@ -3637,7 +3637,7 @@ p_access_yap_flags(void)
+     return(FALSE);		
+   }
+   flag = IntOfTerm(tflag);
+-  if (flag < 0 || flag > NUMBER_OF_YAP_FLAGS) {
++  if (flag < 0 || flag >= NUMBER_OF_YAP_FLAGS) {
+     return(FALSE);
+   }
+ #ifdef TABLING
 -- 
 1.7.11.7
 


More information about the scm-commits mailing list