Changeset cfff43f in git


Ignore:
Timestamp:
Mar 12, 2014, 10:24:14 AM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
61512d30240e4647a653e3178b446f24b9caf87a
Parents:
ab12db732777fc9ca1f9734d184c7e9d38ea9784
Message:
fix: memory allocation off by 1 (nRegister)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/numbers.cc

    rab12db rcfff43f  
    508508    {
    509509      nInitCharTable=(cfInitCharProc*)omAlloc0(
    510                                           nLastCoeffs*sizeof(cfInitCharProc));
     510                                          ((int)nLastCoeffs+1)*sizeof(cfInitCharProc));
    511511      memcpy(nInitCharTable,nInitCharTableDefault,
    512               (nLastCoeffs-1)*sizeof(cfInitCharProc));
     512              ((int)nLastCoeffs)*sizeof(cfInitCharProc));
    513513    }
    514514    else
    515515    {
    516516      nInitCharTable=(cfInitCharProc*)omReallocSize(nInitCharTable,
    517                                           (((int)nLastCoeffs)-1)*sizeof(cfInitCharProc),
    518                                           ((int)nLastCoeffs)*sizeof(cfInitCharProc));
     517                                          ((int)nLastCoeffs)*sizeof(cfInitCharProc),
     518                                          (((int)nLastCoeffs)+1)*sizeof(cfInitCharProc));
    519519    }
    520520
Note: See TracChangeset for help on using the changeset viewer.