diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/English.lproj/InfoPlist.strings | 4 | ||||
-rw-r--r-- | indra/newview/Info-SecondLife.plist | 2 | ||||
-rw-r--r-- | indra/newview/lldrawpoolbump.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llmutelist.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llviewerkeyboard.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llviewerobject.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llwearable.cpp | 9 |
10 files changed, 31 insertions, 18 deletions
diff --git a/indra/newview/English.lproj/InfoPlist.strings b/indra/newview/English.lproj/InfoPlist.strings index ccb92f9fba..2df618fdd7 100644 --- a/indra/newview/English.lproj/InfoPlist.strings +++ b/indra/newview/English.lproj/InfoPlist.strings @@ -1,5 +1,5 @@ /* Localized versions of Info.plist keys */ CFBundleName = "Second Life"; -CFBundleShortVersionString = "Second Life version 1.13.2.11"; -CFBundleGetInfoString = "Second Life version 1.13.2.11, Copyright 2004-2006 Linden Research, Inc."; +CFBundleShortVersionString = "Second Life version 1.13.2.13"; +CFBundleGetInfoString = "Second Life version 1.13.2.13, Copyright 2004-2006 Linden Research, Inc."; diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index 458c5e1b7d..9a935e20a0 100644 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -32,7 +32,7 @@ </dict> </array> <key>CFBundleVersion</key> - <string>1.13.2.11</string> + <string>1.13.2.13</string> <key>CSResourcesFileMapped</key> <true/> </dict> diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index b9d1cb17a0..c1be103b68 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -94,9 +94,10 @@ void LLStandardBumpmap::restoreGL() while( !feof(file) && (LLStandardBumpmap::sStandardBumpmapCount < (U32)TEM_BUMPMAP_COUNT) ) { + // *NOTE: This buffer size is hard coded into scanf() below. char label[2048] = ""; char bump_file[2048] = ""; - fields_read = fscanf( file, "\n%s %s", label, bump_file); + fields_read = fscanf( file, "\n%2047s %2047s", label, bump_file); if( EOF == fields_read ) { break; diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index cf9ae97b5f..0392b38aec 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1947,11 +1947,12 @@ bool LLInventoryModel::loadFromFile( llinfos << "unable to load inventory from: " << filename << llendl; return false; } + // *NOTE: This buffer size is hard coded into scanf() below. char buffer[MAX_STRING]; char keyword[MAX_STRING]; while(!feof(file) && fgets(buffer, MAX_STRING, file)) { - sscanf(buffer, " %s", keyword); + sscanf(buffer, " %254s", keyword); if(0 == strcmp("inv_category", keyword)) { LLPointer<LLViewerInventoryCategory> inv_cat = new LLViewerInventoryCategory(LLUUID::null); diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index fc8ac0a372..53b7bf80f7 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -344,6 +344,8 @@ BOOL LLMuteList::loadFromFile(const LLString& filename) return FALSE; } + // *NOTE: Changing the size of these buffers will require changes + // in the scanf below. char id_buffer[MAX_STRING]; char name_buffer[MAX_STRING]; char buffer[MAX_STRING]; @@ -353,7 +355,7 @@ BOOL LLMuteList::loadFromFile(const LLString& filename) id_buffer[0] = '\0'; name_buffer[0] = '\0'; S32 type = 0; - sscanf(buffer, " %d %s %[^|]", &type, id_buffer, name_buffer); + sscanf(buffer, " %d %254s %254[^|]", &type, id_buffer, name_buffer); LLUUID id = LLUUID(id_buffer); LLMute mute(id, name_buffer, (LLMute::EType)type); if (mute.mID.isNull() diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 9c2638362e..24c230a387 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -430,6 +430,7 @@ bool LLViewerInventoryCategory::fetchDescendents() bool LLViewerInventoryCategory::importFileLocal(FILE* fp) { + // *NOTE: This buffer size is hard coded into scanf() below. char buffer[MAX_STRING]; char keyword[MAX_STRING]; char valuestr[MAX_STRING]; @@ -439,7 +440,7 @@ bool LLViewerInventoryCategory::importFileLocal(FILE* fp) while(!feof(fp)) { fgets(buffer, MAX_STRING, fp); - sscanf(buffer, " %s %s", keyword, valuestr); + sscanf(buffer, " %254s %254s", keyword, valuestr); if(!keyword) { continue; @@ -472,7 +473,7 @@ bool LLViewerInventoryCategory::importFileLocal(FILE* fp) { //strcpy(valuestr, buffer + strlen(keyword) + 3); // *NOTE: Not ANSI C, but widely supported. - sscanf(buffer, " %s %[^|]", keyword, valuestr); + sscanf(buffer, " %254s %254[^|]", keyword, valuestr); mName.assign(valuestr); LLString::replaceNonstandardASCII(mName, ' '); LLString::replaceChar(mName, '|', ' '); diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 8f31f1192a..714087e701 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -685,6 +685,7 @@ S32 LLViewerKeyboard::loadBindings(const char *filename) FILE *fp; const S32 BUFFER_SIZE = 2048; char buffer[BUFFER_SIZE]; + // *NOTE: This buffer size is hard coded into scanf() below. char mode_string[MAX_STRING]; char key_string[MAX_STRING]; char mask_string[MAX_STRING]; @@ -714,7 +715,7 @@ S32 LLViewerKeyboard::loadBindings(const char *filename) if (buffer[0] == '#' || buffer[0] == '\n') continue; // grab the binding strings - tokens_read = sscanf(buffer, "%s %s %s %s", mode_string, key_string, mask_string, function_string); + tokens_read = sscanf(buffer, "%254s %254s %254s %254s", mode_string, key_string, mask_string, function_string); if (tokens_read == EOF) { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 5ce64156a0..b2889f961a 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3946,6 +3946,7 @@ void force_import_geometry(void*) child = root->getNextNamedChild()) { // get object data + // *NOTE: This buffer size is hard coded into scanf() below. char name[255]; // Shape char description[255]; // Description U32 material; // Material @@ -3978,9 +3979,9 @@ void force_import_geometry(void*) child->getAttributeString("PCode", &attribute); pcode = atoi(attribute.c_str()); child->getAttributeString("Shape", &attribute); - sscanf(attribute.c_str(), "%s", name); + sscanf(attribute.c_str(), "%254s", name); child->getAttributeString("Description", &attribute); - sscanf(attribute.c_str(), "%s", description); + sscanf(attribute.c_str(), "%254s", description); child->getAttributeString("Material", &attribute); material = atoi(attribute.c_str()); child->getAttributeString("Scale", &attribute); @@ -4060,6 +4061,7 @@ void force_import_geometry(void*) // read the faces U32 facenumber; LLColor4 color; + // *NOTE: This buffer size is hard coded into scanf() below. char texture[UUID_STR_LENGTH]; LLUUID texid; texid.toString(texture); @@ -4070,7 +4072,7 @@ void force_import_geometry(void*) face->getAttributeString("FaceColor", &attribute); sscanf(attribute, "%d %f %f %f %f", &facenumber, &color.mV[VX], &color.mV[VY], &color.mV[VZ], &color.mV[VW]); face->getAttributeString("Face", &attribute); - sscanf(attribute, "%d %f %f %f %f %f %d %s", &facenumber, &sx, &sy, &ox, &oy, &rot, &bump, texture); + sscanf(attribute, "%d %f %f %f %f %f %d %36s", &facenumber, &sx, &sy, &ox, &oy, &rot, &bump, texture); texid.set(texture); te.setColor(color); te.setBumpShinyFullbright(bump); @@ -5487,7 +5489,8 @@ void upload_new_resource(const LLString& src_filename, std::string name, if (fscanf(in, "LindenResource\nversion %d\n", &version)) { if (2 == version) - { + { + // *NOTE: This buffer size is hard coded into scanf() below. char label[MAX_STRING]; char value[MAX_STRING]; S32 tokens_read; @@ -5495,7 +5498,7 @@ void upload_new_resource(const LLString& src_filename, std::string name, { label[0] = '\0'; value[0] = '\0'; - tokens_read = sscanf(buf, "%s %s\n", label, value); + tokens_read = sscanf(buf, "%254s %254s\n", label, value); llinfos << "got: " << label << " = " << value << llendl; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 0d1910429e..0f1479af68 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2377,6 +2377,7 @@ void LLViewerObject::loadTaskInvFile(const char* filename) if(ifs.good()) { char buffer[MAX_STRING]; + // *NOTE: This buffer size is hard coded into scanf() below. char keyword[MAX_STRING]; if(mInventory) { @@ -2389,7 +2390,7 @@ void LLViewerObject::loadTaskInvFile(const char* filename) while(ifs.good()) { ifs.getline(buffer, MAX_STRING); - sscanf(buffer, " %s", keyword); + sscanf(buffer, " %254s", keyword); if(0 == strcmp("inv_item", keyword)) { LLPointer<LLInventoryObject> inv = new LLViewerInventoryItem; diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index ebe3c69c5c..4fe8a4b98e 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -246,6 +246,9 @@ BOOL LLWearable::exportFile( FILE* file ) BOOL LLWearable::importFile( FILE* file ) { + // *NOTE: changing the type or size of this buffer will require + // changes in the fscanf() code below. You would be better off + // rewriting this to use streams and not require an open FILE. char text_buffer[2048]; S32 fields_read = 0; @@ -276,7 +279,7 @@ BOOL LLWearable::importFile( FILE* file ) else { ungetc( next_char, file ); - fields_read = fscanf( file, "%[^\n]", text_buffer ); + fields_read = fscanf( file, "%2047[^\n]", text_buffer ); if( (1 != fields_read) || (fgetc( file ) != '\n') ) { llwarns << "Bad Wearable asset: early end of file" << llendl; @@ -296,7 +299,7 @@ BOOL LLWearable::importFile( FILE* file ) else { ungetc( next_char, file ); - fields_read = fscanf( file, "%[^\n]", text_buffer ); + fields_read = fscanf( file, "%2047[^\n]", text_buffer ); if( (1 != fields_read) || (fgetc( file ) != '\n') ) { llwarns << "Bad Wearable asset: early end of file" << llendl; @@ -403,7 +406,7 @@ BOOL LLWearable::importFile( FILE* file ) for( i = 0; i < num_textures; i++ ) { S32 te = 0; - fields_read = fscanf( file, "%d %s\n", &te, text_buffer); + fields_read = fscanf( file, "%d %2047s\n", &te, text_buffer); if( fields_read != 2 ) { llwarns << "Bad Wearable asset: bad texture, #" << i << llendl; |