diff options
author | Don Kjer <don@lindenlab.com> | 2007-07-20 20:38:05 +0000 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2007-07-20 20:38:05 +0000 |
commit | d373dcc7cbed5fdea72c6b71a5594e4e85549b43 (patch) | |
tree | 140e20f48db5dc4d7842f05ef2c24ef9e6fc3238 /indra/lscript/lscript_execute | |
parent | c78f99b0b3b4b9ac99a69b63315e821d89a89a3b (diff) |
svn merge -r 64548:64837 svn+ssh://svn/svn/linden/branches/maintenance into release
* WARNING *: maintenance r64837 is not the last rev to use in the next merge. use r65269
Diffstat (limited to 'indra/lscript/lscript_execute')
-rw-r--r-- | indra/lscript/lscript_execute/lscript_execute.cpp | 14 | ||||
-rw-r--r-- | indra/lscript/lscript_execute/lscript_readlso.cpp | 14 |
2 files changed, 22 insertions, 6 deletions
diff --git a/indra/lscript/lscript_execute/lscript_execute.cpp b/indra/lscript/lscript_execute/lscript_execute.cpp index 196ca07d1d..b166e922a2 100644 --- a/indra/lscript/lscript_execute/lscript_execute.cpp +++ b/indra/lscript/lscript_execute/lscript_execute.cpp @@ -43,11 +43,19 @@ LLScriptExecute::LLScriptExecute(FILE *fp) U8 sizearray[4]; S32 filesize; S32 pos = 0; - fread(&sizearray, 1, 4, fp); - filesize = bytestream2integer(sizearray, pos); + if (fread(&sizearray, 1, 4, fp) != 4) + { + llwarns << "Short read" << llendl; + filesize = 0; + } else { + filesize = bytestream2integer(sizearray, pos); + } mBuffer = new U8[filesize]; fseek(fp, 0, SEEK_SET); - fread(mBuffer, 1, filesize, fp); + if (fread(mBuffer, 1, filesize, fp) != filesize) + { + llwarns << "Short read" << llendl; + } fclose(fp); init(); diff --git a/indra/lscript/lscript_execute/lscript_readlso.cpp b/indra/lscript/lscript_execute/lscript_readlso.cpp index 669a9b6a06..0021a87d65 100644 --- a/indra/lscript/lscript_execute/lscript_readlso.cpp +++ b/indra/lscript/lscript_execute/lscript_readlso.cpp @@ -17,11 +17,19 @@ LLScriptLSOParse::LLScriptLSOParse(FILE *fp) U8 sizearray[4]; S32 filesize; S32 pos = 0; - fread(&sizearray, 1, 4, fp); - filesize = bytestream2integer(sizearray, pos); + if (fread(&sizearray, 1, 4, fp) != 4) + { + llwarns << "Short read" << llendl; + filesize = 0; + } else { + filesize = bytestream2integer(sizearray, pos); + } mRawData = new U8[filesize]; fseek(fp, 0, SEEK_SET); - fread(mRawData, 1, filesize, fp); + if (fread(mRawData, 1, filesize, fp) != filesize) + { + llwarns << "Short read" << llendl; + } initOpCodePrinting(); } |