소스 검색

Replaced buffer allocated on the stack with buffer allocated

on the heap.  Reason:  Parsing an attribute with a large number
of bytes resulted in a stack overflow.


git-svn-id: https://svn.microneil.com/svn/CodeDweller/branches/adeniz_1@108 d34b734f-a00e-4b39-a726-e4eeb87269ab
adeniz_1
adeniz 9 년 전
부모
커밋
cf43979e2d
1개의 변경된 파일7개의 추가작업 그리고 6개의 파일을 삭제
  1. 7
    6
      XMLReader.cpp

+ 7
- 6
XMLReader.cpp 파일 보기

@@ -21,9 +21,8 @@

// See XMLReader.hpp for details

//debug
#include <iostream>
//end of debug
#include <vector>

#include "CodeDweller/XMLReader.hpp"

using namespace std;
@@ -929,8 +928,9 @@ bool XMLReaderElement::interpret(XMLReaderData& Data) {
) { // then translate the content!
// Create the Content buffer...

int BfrSize = Stopdex - Startdex; // How big a buffer do we need?
char Bfr[BfrSize]; // Make one that size.
int BfrSize = Stopdex - Startdex + 1; // How big a buffer do we need?
vector<char> heapBfr(BfrSize, 0); // Make one that size.
char *Bfr = &(heapBfr[0]);

copyDataCountLines(Bfr, Data, Startdex, Stopdex); // Get our data and ignore our lines.

@@ -1127,7 +1127,8 @@ bool XMLReaderAttribute::interpret(XMLReaderData& Data) {

int BfrSize = Stopdex - Startdex + 1; // How big a buffer do we need?
// Add byte for null terminator.
char Bfr[BfrSize]; // Make one that size.
vector<char> heapBfr(BfrSize, 0); // Make one that size.
char *Bfr = &(heapBfr[0]);

NewLines += copyDataCountLines(Bfr, Data, Startdex, Stopdex); // Get our data and count our lines.


Loading…
취소
저장