aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llprimitive
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:56 -0500
committerJacek Antonelli2008-08-15 23:44:56 -0500
commitc07901e29ed545bbb02e3bddf148fe1104b94e9f (patch)
treef1ada64ce834acd7d92a425efb96c4b86bcf16b1 /linden/indra/llprimitive
parentSecond Life viewer sources 1.15.0.2 (diff)
downloadmeta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.zip
meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.gz
meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.bz2
meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.xz
Second Life viewer sources 1.15.1.3
Diffstat (limited to 'linden/indra/llprimitive')
-rw-r--r--linden/indra/llprimitive/llprimitive.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/linden/indra/llprimitive/llprimitive.cpp b/linden/indra/llprimitive/llprimitive.cpp
index e2cf7e3..9ab44f7 100644
--- a/linden/indra/llprimitive/llprimitive.cpp
+++ b/linden/indra/llprimitive/llprimitive.cpp
@@ -797,14 +797,14 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode)
797 { 797 {
798 snprintf(mask, sizeof(mask), "hemi"); /* Flawfinder: ignore */ 798 snprintf(mask, sizeof(mask), "hemi"); /* Flawfinder: ignore */
799 } 799 }
800 else if (mask != 0) 800 else
801 { 801 {
802 snprintf(mask, sizeof(mask), "%x", mask_code); /* Flawfinder: ignore */ 802 snprintf(mask, sizeof(mask), "%x", mask_code); /* Flawfinder: ignore */
803 } 803 }
804 else 804
805 { 805 // extra sanity against snprintf() being naturally crap
806 mask[0] = 0; 806 mask[sizeof(mask)-1] = '\0';
807 } 807 shape[sizeof(shape)-1] = '\0';
808 808
809 if (mask[0]) 809 if (mask[0])
810 { 810 {
@@ -815,6 +815,11 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode)
815 snprintf(pcode_string, sizeof(pcode_string), "%s", shape); /* Flawfinder: ignore */ 815 snprintf(pcode_string, sizeof(pcode_string), "%s", shape); /* Flawfinder: ignore */
816 } 816 }
817 } 817 }
818
819 // Be really sure that pcode_string is nul-terminated after we've
820 // been using crappy snprintf() to build it.
821 pcode_string[sizeof(pcode_string)-1] = '\0';
822
818 return pcode_string; 823 return pcode_string;
819} 824}
820 825