aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llinventory/llpermissions.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llinventory/llpermissions.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/linden/indra/llinventory/llpermissions.cpp b/linden/indra/llinventory/llpermissions.cpp
index 39e7a72..35dbc3e 100644
--- a/linden/indra/llinventory/llpermissions.cpp
+++ b/linden/indra/llinventory/llpermissions.cpp
@@ -511,6 +511,8 @@ BOOL LLPermissions::importFile(FILE *fp)
511 init(LLUUID::null, LLUUID::null, LLUUID::null, LLUUID::null); 511 init(LLUUID::null, LLUUID::null, LLUUID::null, LLUUID::null);
512 const S32 BUFSIZE = 16384; 512 const S32 BUFSIZE = 16384;
513 513
514 // *NOTE: Changing the buffer size will require changing the scanf
515 // calls below.
514 char buffer[BUFSIZE]; 516 char buffer[BUFSIZE];
515 char keyword[256]; 517 char keyword[256];
516 char valuestr[256]; 518 char valuestr[256];
@@ -523,7 +525,7 @@ BOOL LLPermissions::importFile(FILE *fp)
523 while (!feof(fp)) 525 while (!feof(fp))
524 { 526 {
525 fgets(buffer, BUFSIZE, fp); 527 fgets(buffer, BUFSIZE, fp);
526 sscanf(buffer, " %s %s", keyword, valuestr); 528 sscanf(buffer, " %255s %255s", keyword, valuestr);
527 if (!keyword) 529 if (!keyword)
528 { 530 {
529 continue; 531 continue;
@@ -571,22 +573,22 @@ BOOL LLPermissions::importFile(FILE *fp)
571 } 573 }
572 else if (!strcmp("creator_id", keyword)) 574 else if (!strcmp("creator_id", keyword))
573 { 575 {
574 sscanf(valuestr, "%s", uuid_str); 576 sscanf(valuestr, "%255s", uuid_str);
575 mCreator.set(uuid_str); 577 mCreator.set(uuid_str);
576 } 578 }
577 else if (!strcmp("owner_id", keyword)) 579 else if (!strcmp("owner_id", keyword))
578 { 580 {
579 sscanf(valuestr, "%s", uuid_str); 581 sscanf(valuestr, "%255s", uuid_str);
580 mOwner.set(uuid_str); 582 mOwner.set(uuid_str);
581 } 583 }
582 else if (!strcmp("last_owner_id", keyword)) 584 else if (!strcmp("last_owner_id", keyword))
583 { 585 {
584 sscanf(valuestr, "%s", uuid_str); 586 sscanf(valuestr, "%255s", uuid_str);
585 mLastOwner.set(uuid_str); 587 mLastOwner.set(uuid_str);
586 } 588 }
587 else if (!strcmp("group_id", keyword)) 589 else if (!strcmp("group_id", keyword))
588 { 590 {
589 sscanf(valuestr, "%s", uuid_str); 591 sscanf(valuestr, "%255s", uuid_str);
590 mGroup.set(uuid_str); 592 mGroup.set(uuid_str);
591 } 593 }
592 else if (!strcmp("group_owned", keyword)) 594 else if (!strcmp("group_owned", keyword))
@@ -644,6 +646,8 @@ BOOL LLPermissions::importLegacyStream(std::istream& input_stream)
644 init(LLUUID::null, LLUUID::null, LLUUID::null, LLUUID::null); 646 init(LLUUID::null, LLUUID::null, LLUUID::null, LLUUID::null);
645 const S32 BUFSIZE = 16384; 647 const S32 BUFSIZE = 16384;
646 648
649 // *NOTE: Changing the buffer size will require changing the scanf
650 // calls below.
647 char buffer[BUFSIZE]; 651 char buffer[BUFSIZE];
648 char keyword[256]; 652 char keyword[256];
649 char valuestr[256]; 653 char valuestr[256];
@@ -656,7 +660,7 @@ BOOL LLPermissions::importLegacyStream(std::istream& input_stream)
656 while (input_stream.good()) 660 while (input_stream.good())
657 { 661 {
658 input_stream.getline(buffer, BUFSIZE); 662 input_stream.getline(buffer, BUFSIZE);
659 sscanf(buffer, " %s %s", keyword, valuestr); 663 sscanf(buffer, " %255s %255s", keyword, valuestr);
660 if (!keyword) 664 if (!keyword)
661 { 665 {
662 continue; 666 continue;
@@ -704,22 +708,22 @@ BOOL LLPermissions::importLegacyStream(std::istream& input_stream)
704 } 708 }
705 else if (!strcmp("creator_id", keyword)) 709 else if (!strcmp("creator_id", keyword))
706 { 710 {
707 sscanf(valuestr, "%s", uuid_str); 711 sscanf(valuestr, "%255s", uuid_str);
708 mCreator.set(uuid_str); 712 mCreator.set(uuid_str);
709 } 713 }
710 else if (!strcmp("owner_id", keyword)) 714 else if (!strcmp("owner_id", keyword))
711 { 715 {
712 sscanf(valuestr, "%s", uuid_str); 716 sscanf(valuestr, "%255s", uuid_str);
713 mOwner.set(uuid_str); 717 mOwner.set(uuid_str);
714 } 718 }
715 else if (!strcmp("last_owner_id", keyword)) 719 else if (!strcmp("last_owner_id", keyword))
716 { 720 {
717 sscanf(valuestr, "%s", uuid_str); 721 sscanf(valuestr, "%255s", uuid_str);
718 mLastOwner.set(uuid_str); 722 mLastOwner.set(uuid_str);
719 } 723 }
720 else if (!strcmp("group_id", keyword)) 724 else if (!strcmp("group_id", keyword))
721 { 725 {
722 sscanf(valuestr, "%s", uuid_str); 726 sscanf(valuestr, "%255s", uuid_str);
723 mGroup.set(uuid_str); 727 mGroup.set(uuid_str);
724 } 728 }
725 else if (!strcmp("group_owned", keyword)) 729 else if (!strcmp("group_owned", keyword))