Ticket #11748: 0001-CID-20155-Negative-array-index-read-Added-negative-i.patch

File 0001-CID-20155-Negative-array-index-read-Added-negative-i.patch, 902 bytes (added by sli908, 5 years ago)

Patch that adds index check

  • src/bin/gawk/intl/finddomain.c

    From 9bbd7f672aa94c2a91818c365571b072d5cbbfba Mon Sep 17 00:00:00 2001
    From: Sid Kurella <mastersidkurella@gmail.com>
    Date: Mon, 12 Jan 2015 19:02:45 -0500
    Subject: [PATCH] CID 20155: Negative array index read - Added negative index
     check
    
    ---
     src/bin/gawk/intl/finddomain.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/bin/gawk/intl/finddomain.c b/src/bin/gawk/intl/finddomain.c
    index d242764..21334e6 100644
    a b _nl_find_domain (dirname, locale, domainname, domainbinding)  
    102102      if (retval->data != NULL)
    103103    return retval;
    104104
    105       for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
     105      for (cnt = 0; cnt >= 0 && retval->successor[cnt] != NULL; ++cnt)
    106106    {
    107107      if (retval->successor[cnt]->decided == 0)
    108108        _nl_load_domain (retval->successor[cnt], domainbinding);