소스 검색

addressing false positive jsverify rngState 0dc9b3f5704ad26e18

El RIDO 1 년 전
부모
커밋
47d7f5bc60
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      js/test/AttachmentViewer.js

+ 5 - 2
js/test/AttachmentViewer.js

@@ -24,8 +24,12 @@ describe('AttachmentViewer', function () {
                     ),
                     results = [],
                     result = '';
+                // text node of attachment will truncate at null byte
+                if (filename === '\u0000') {
+                    filename = '';
+                }
                 prefix  = prefix.replace(/%(s|d)/g, '%%');
-                postfix = postfix.replace(/%(s|d)/g, '%%');
+                postfix = postfix.replace(/%(s|d)/g, '%%').replace(/<|>/g, '');
                 $('body').html(
                     '<div id="attachmentPreview" class="col-md-12 text-center hidden"></div>' +
                     '<div id="attachment" class="hidden"></div>' +
@@ -126,4 +130,3 @@ describe('AttachmentViewer', function () {
         );
     });
 });
-