Browse code

pull request #53(2/4): Spelling fix by klemens(ka7).

Steven Morgan authored on 2016/10/20 04:57:45
Showing 16 changed files
... ...
@@ -1821,7 +1821,7 @@ int cli_bytecode_run(const struct cli_all_bc *bcs, const struct cli_bc *bc, stru
1821 1821
 	inst.u.ops.funcid = ctx->funcid;
1822 1822
 	inst.u.ops.ops = ctx->operands;
1823 1823
 	inst.u.ops.opsizes = ctx->opsizes;
1824
-	cli_dbgmsg("Bytecode %u: executing in interpeter mode\n", bc->id);
1824
+	cli_dbgmsg("Bytecode %u: executing in interpreter mode\n", bc->id);
1825 1825
 
1826 1826
 	ctx->on_jit = 0;
1827 1827
 
... ...
@@ -52,7 +52,7 @@
52 52
 
53 53
 using namespace llvm;
54 54
 #if LLVM_VERSION < 29
55
-/* function is succeeded in later LLVM with LLVM correspoding standalone */
55
+/* function is succeeded in later LLVM with LLVM corresponding standalone */
56 56
 static Value *GetUnderlyingObject(Value *P, TargetData *TD)
57 57
 {
58 58
     return P->getUnderlyingObject();
... ...
@@ -2736,7 +2736,7 @@ int cli_bytecode_prepare_jit(struct cli_all_bc *bcs)
2736 2736
 		 badalloc.what());
2737 2737
       return CL_EMEM;
2738 2738
   } catch (...) {
2739
-      cli_errmsg("[Bytecode JIT]: Unexpected unknown exception occured\n");
2739
+      cli_errmsg("[Bytecode JIT]: Unexpected unknown exception occurred\n");
2740 2740
       return CL_EBYTECODE;
2741 2741
   }
2742 2742
   return 0;
... ...
@@ -162,7 +162,7 @@ enum X86OPS {
162 162
   OP_RCR,/**< Rotate Carry Right */
163 163
   OP_RDMSR,/**< Read from Model Specific Register */
164 164
   OP_RDPMC,/**< Read Performance Monitoring Counters */
165
-  OP_RDTSC,/**< Read Time-Stamp Coutner */
165
+  OP_RDTSC,/**< Read Time-Stamp Counter */
166 166
   OP_PREFIX_REPE,/**< Repeat String Operation Prefix while Equal */
167 167
   OP_PREFIX_REPNE,/**< Repeat String Operation Prefix while Not Equal */
168 168
   OP_RETF,/**< Return from Far Procedure */
... ...
@@ -134,9 +134,9 @@ static inline void PROFILE_REPORT(const struct cli_hashtable *s)
134 134
 	size_t lookups, queries, insert_tries, inserts;
135 135
 	cli_dbgmsg("--------Hashtable usage report for %p--------------\n",(const void*)s);
136 136
 	cli_dbgmsg("hash function calculations:%ld\n",s->PROFILE_STRUCT.calc_hash);
137
-	cli_dbgmsg("successfull finds/total searches: %ld/%ld; lookups: %ld\n", s->PROFILE_STRUCT.found, s->PROFILE_STRUCT.find_req, s->PROFILE_STRUCT.found_tries);
138
-	cli_dbgmsg("unsuccessfull finds/total searches: %ld/%ld; lookups: %ld\n", s->PROFILE_STRUCT.not_found, s->PROFILE_STRUCT.find_req , s->PROFILE_STRUCT.not_found_tries);
139
-	cli_dbgmsg("successfull finds during grow:%ld; lookups: %ld\n",s->PROFILE_STRUCT.grow_found, s->PROFILE_STRUCT.grow_found_tries);
137
+	cli_dbgmsg("successful finds/total searches: %ld/%ld; lookups: %ld\n", s->PROFILE_STRUCT.found, s->PROFILE_STRUCT.find_req, s->PROFILE_STRUCT.found_tries);
138
+	cli_dbgmsg("unsuccessful finds/total searches: %ld/%ld; lookups: %ld\n", s->PROFILE_STRUCT.not_found, s->PROFILE_STRUCT.find_req , s->PROFILE_STRUCT.not_found_tries);
139
+	cli_dbgmsg("successful finds during grow:%ld; lookups: %ld\n",s->PROFILE_STRUCT.grow_found, s->PROFILE_STRUCT.grow_found_tries);
140 140
 	lookups = s->PROFILE_STRUCT.found_tries + s->PROFILE_STRUCT.not_found_tries + s->PROFILE_STRUCT.grow_found_tries;
141 141
 	queries = s->PROFILE_STRUCT.find_req + s->PROFILE_STRUCT.grow_found;
142 142
 	cli_dbgmsg("Find Lookups/total queries: %ld/%ld = %3f\n", lookups, queries, lookups*1.0/queries);
... ...
@@ -739,7 +739,7 @@ static inline size_t cli_hashset_search(const struct cli_hashset* hs, const uint
739 739
 	size_t idx = hash32shift(key) & (hs->mask);
740 740
 	size_t tries = 1;
741 741
 
742
-	/* check wether the entry is used, and if the key matches */
742
+	/* check whether the entry is used, and if the key matches */
743 743
 	while(BITMAP_CONTAINS(hs->bitmap, idx) && (hs->keys[idx] != key)) {
744 744
 		/* entry used, key different -> collision */
745 745
 		idx = (idx + tries++)&(hs->mask);
... ...
@@ -1036,7 +1036,7 @@ static inline int parsehwp3_paragraph(cli_ctx *ctx, fmap_t *map, int p, int leve
1036 1036
 
1037 1037
                     hwp3_debug("HWP3.x: Paragraph[%d, %d]: box object contains %u cell(s)\n", level, p, ncells);
1038 1038
 
1039
-                    /* cell informations (27 bytes x ncells(offset 80 of table)) */
1039
+                    /* cell information (27 bytes x ncells(offset 80 of table)) */
1040 1040
                     hwp3_debug("HWP3.x: Paragraph[%d, %d]: box cell info array starts @ %llu\n", level, p, (long long unsigned)offset);
1041 1041
                     offset += (27 * ncells);
1042 1042
 
... ...
@@ -1525,7 +1525,7 @@ static inline int parsehwp3_infoblk_1(cli_ctx *ctx, fmap_t *dmap, off_t *offset,
1525 1525
 #endif
1526 1526
 
1527 1527
     if (fmap_readn(map, &infoid, (*offset), sizeof(infoid)) != sizeof(infoid)) {
1528
-        cli_errmsg("HWP3.x: Failed to read infomation block id @ %llu\n",
1528
+        cli_errmsg("HWP3.x: Failed to read information block id @ %llu\n",
1529 1529
                    (long long unsigned)(*offset));
1530 1530
         return CL_EREAD;
1531 1531
     }
... ...
@@ -1547,16 +1547,16 @@ static inline int parsehwp3_infoblk_1(cli_ctx *ctx, fmap_t *dmap, off_t *offset,
1547 1547
 
1548 1548
     /* Booking Information(5) - no length field and no content */
1549 1549
     if (infoid == 5) {
1550
-        hwp3_debug("HWP3.x: Information Block[%llu]: TYPE: Booking Infomation\n", infoloc);
1550
+        hwp3_debug("HWP3.x: Information Block[%llu]: TYPE: Booking Information\n", infoloc);
1551 1551
 #if HAVE_JSON
1552 1552
         if (ctx->options & CL_SCAN_FILE_PROPERTIES)
1553
-            cli_jsonstr(entry, "Type", "Booking Infomation");
1553
+            cli_jsonstr(entry, "Type", "Booking Information");
1554 1554
 #endif
1555 1555
         return CL_SUCCESS;
1556 1556
     }
1557 1557
 
1558 1558
     if (fmap_readn(map, &infolen, (*offset), sizeof(infolen)) != sizeof(infolen)) {
1559
-        cli_errmsg("HWP3.x: Failed to read infomation block len @ %llu\n",
1559
+        cli_errmsg("HWP3.x: Failed to read information block len @ %llu\n",
1560 1560
                    (long long unsigned)(*offset));
1561 1561
         return CL_EREAD;
1562 1562
     }
... ...
@@ -1602,7 +1602,7 @@ static inline int parsehwp3_infoblk_1(cli_ctx *ctx, fmap_t *dmap, off_t *offset,
1602 1602
 #if HWP3_DEBUG /* additional fields can be added */
1603 1603
         memset(field, 0, HWP3_FIELD_LENGTH);
1604 1604
         if (fmap_readn(map, field, (*offset), 16) != 16) {
1605
-            cli_errmsg("HWP3.x: Failed to read infomation block field @ %llu\n",
1605
+            cli_errmsg("HWP3.x: Failed to read information block field @ %llu\n",
1606 1606
                        (long long unsigned)(*offset));
1607 1607
             return CL_EREAD;
1608 1608
         }
... ...
@@ -1610,7 +1610,7 @@ static inline int parsehwp3_infoblk_1(cli_ctx *ctx, fmap_t *dmap, off_t *offset,
1610 1610
 
1611 1611
         memset(field, 0, HWP3_FIELD_LENGTH);
1612 1612
         if (fmap_readn(map, field, (*offset)+16, 16) != 16) {
1613
-            cli_errmsg("HWP3.x: Failed to read infomation block field @ %llu\n",
1613
+            cli_errmsg("HWP3.x: Failed to read information block field @ %llu\n",
1614 1614
                        (long long unsigned)(*offset));
1615 1615
             return CL_EREAD;
1616 1616
         }
... ...
@@ -1630,7 +1630,7 @@ static inline int parsehwp3_infoblk_1(cli_ctx *ctx, fmap_t *dmap, off_t *offset,
1630 1630
             ret = cli_map_scan(map, (*offset), infolen, ctx, CL_TYPE_ANY);
1631 1631
         break;
1632 1632
     case 3: /* Hypertext/Hyperlink Information */
1633
-        hwp3_debug("HWP3.x: Information Block[%llu]: TYPE: Hypertext/Hyperlink Infomation\n", infoloc);
1633
+        hwp3_debug("HWP3.x: Information Block[%llu]: TYPE: Hypertext/Hyperlink Information\n", infoloc);
1634 1634
         if (infolen % 617) {
1635 1635
             cli_errmsg("HWP3.x: Information Block[%llu]: Invalid multiple of 617 => %u\n", infoloc, infolen);
1636 1636
             return CL_EFORMAT;
... ...
@@ -1640,7 +1640,7 @@ static inline int parsehwp3_infoblk_1(cli_ctx *ctx, fmap_t *dmap, off_t *offset,
1640 1640
         hwp3_debug("HWP3.x: Information Block[%llu]: COUNT: %d entries\n", infoloc, count);
1641 1641
 #if HAVE_JSON
1642 1642
         if (ctx->options & CL_SCAN_FILE_PROPERTIES) {
1643
-            cli_jsonstr(entry, "Type", "Hypertext/Hyperlink Infomation");
1643
+            cli_jsonstr(entry, "Type", "Hypertext/Hyperlink Information");
1644 1644
             cli_jsonint(entry, "Count", count);
1645 1645
         }
1646 1646
 #endif
... ...
@@ -1649,7 +1649,7 @@ static inline int parsehwp3_infoblk_1(cli_ctx *ctx, fmap_t *dmap, off_t *offset,
1649 1649
 #if HWP3_DEBUG /* additional fields can be added */
1650 1650
             memset(field, 0, HWP3_FIELD_LENGTH);
1651 1651
             if (fmap_readn(map, field, (*offset), 256) != 256) {
1652
-                cli_errmsg("HWP3.x: Failed to read infomation block field @ %llu\n",
1652
+                cli_errmsg("HWP3.x: Failed to read information block field @ %llu\n",
1653 1653
                            (long long unsigned)(*offset));
1654 1654
                 return CL_EREAD;
1655 1655
             }
... ...
@@ -1669,7 +1669,7 @@ static inline int parsehwp3_infoblk_1(cli_ctx *ctx, fmap_t *dmap, off_t *offset,
1669 1669
         break;
1670 1670
     case 5: /* Booking Information */
1671 1671
         /* should never run this as it is short-circuited above */
1672
-        hwp3_debug("HWP3.x: Information Block[%llu]: TYPE: Booking Infomation\n", infoloc);
1672
+        hwp3_debug("HWP3.x: Information Block[%llu]: TYPE: Booking Information\n", infoloc);
1673 1673
 #if HAVE_JSON
1674 1674
         if (ctx->options & CL_SCAN_FILE_PROPERTIES)
1675 1675
             cli_jsonstr(entry, "Type", "Booking Information");
... ...
@@ -1686,7 +1686,7 @@ static inline int parsehwp3_infoblk_1(cli_ctx *ctx, fmap_t *dmap, off_t *offset,
1686 1686
 #if HWP3_DEBUG /* additional fields can be added */
1687 1687
         memset(field, 0, HWP3_FIELD_LENGTH);
1688 1688
         if (fmap_readn(map, field, (*offset)+24, 256) != 256) {
1689
-            cli_errmsg("HWP3.x: Failed to read infomation block field @ %llu\n",
1689
+            cli_errmsg("HWP3.x: Failed to read information block field @ %llu\n",
1690 1690
                        (long long unsigned)(*offset));
1691 1691
             return CL_EREAD;
1692 1692
         }
... ...
@@ -2074,7 +2074,7 @@ int cli_scanhwpml(cli_ctx *ctx)
2074 2074
 
2075 2075
     reader = xmlReaderForIO(msxml_read_cb, NULL, &cbdata, "hwpml.xml", NULL, CLAMAV_MIN_XMLREADER_FLAGS);
2076 2076
     if (!reader) {
2077
-        cli_dbgmsg("cli_scanhwpml: cannot intialize xmlReader\n");
2077
+        cli_dbgmsg("cli_scanhwpml: cannot initialize xmlReader\n");
2078 2078
 
2079 2079
 #if HAVE_JSON
2080 2080
         ret = cli_json_parse_error(ctx->wrkproperty, "HWPML_ERROR_XML_READER_IO");
... ...
@@ -871,7 +871,7 @@ void cli_js_parse_done(struct parser_state* state)
871 871
 	}
872 872
 	if (end != '\0')
873 873
 		cli_js_process_buffer(state, &end, 1);
874
-	/* close remaining paranthesis */
874
+	/* close remaining parenthesis */
875 875
 	for (i=0;i<tokens->cnt;i++) {
876 876
 		if (tokens->data[i].type == TOK_PAR_OPEN)
877 877
 			par_balance++;
... ...
@@ -887,7 +887,7 @@ void cli_js_parse_done(struct parser_state* state)
887 887
 		}
888 888
 	}
889 889
 
890
-	/* we had to close unfinished strings, paranthesis,
890
+	/* we had to close unfinished strings, parenthesis,
891 891
 	 * so that the folders/decoders can run properly */
892 892
 	run_folders(&state->tokens);
893 893
 	run_decoders(state);
... ...
@@ -444,7 +444,7 @@ int cli_pcre_build(struct cli_matcher *root, long long unsigned match_limit, lon
444 444
             ret = cli_pcre_compile(&(pm->pdata), match_limit, recmatch_limit, 0, 0);
445 445
         }
446 446
         else {
447
-            /* compile the regex, options overrided and disabled */
447
+            /* compile the regex, options overridden and disabled */
448 448
             pm_dbgmsg("cli_pcre_build: Compiling regex: /%s/ (without options)\n", pm->pdata.expression);
449 449
             ret = cli_pcre_compile(&(pm->pdata), match_limit, recmatch_limit, 0, 1);
450 450
         }
... ...
@@ -627,7 +627,7 @@ int cli_pcre_scanbuf(const unsigned char *buffer, uint32_t length, const char **
627 627
                     continue;
628 628
         }
629 629
         else {
630
-            cli_dbgmsg("cli_pcre_scanbuf: skipping %s check due to unintialized lsigid\n", pm->trigger);
630
+            cli_dbgmsg("cli_pcre_scanbuf: skipping %s check due to uninitialized lsigid\n", pm->trigger);
631 631
             /* fall-through to unconditional execution - sigtool-only */
632 632
         }
633 633
 
... ...
@@ -1046,7 +1046,7 @@ parseEmailHeader(message *m, const char *line, const table_t *rfc821)
1046 1046
 	 * In RFC822 the separater between the key a value is a colon,
1047 1047
 	 * e.g.	Content-Transfer-Encoding: base64
1048 1048
 	 * However some MUA's are lapse about this and virus writers exploit
1049
-	 * this hole, so we need to check all known possiblities
1049
+	 * this hole, so we need to check all known possibilities
1050 1050
 	 */
1051 1051
 	for(separater = ":= "; *separater; separater++)
1052 1052
 		if(strchr(line, *separater) != NULL)
... ...
@@ -134,7 +134,7 @@ int cli_mbr_check2(cli_ctx *ctx, size_t sectorsize) {
134 134
     return mbr_check_mbr(&mbr, maplen, sectorsize);
135 135
 }
136 136
 
137
-/* sets sectorsize to default value if specfied to be 0 */
137
+/* sets sectorsize to default value if specified to be 0 */
138 138
 int cli_scanmbr(cli_ctx *ctx, size_t sectorsize)
139 139
 {
140 140
     struct mbr_boot_record mbr;
... ...
@@ -225,7 +225,7 @@ int cli_scanmbr(cli_ctx *ctx, size_t sectorsize)
225 225
                 cli_dbgmsg("cli_scanmbr: detected a master boot record "
226 226
                            "with multiple extended partitions\n");
227 227
             }
228
-            state = SEEN_EXTENDED; /* used only to detect mutiple extended partitions */
228
+            state = SEEN_EXTENDED; /* used only to detect multiple extended partitions */
229 229
 
230 230
             ret = mbr_scanextprtn(ctx, &prtncount, mbr.entries[i].firstLBA, 
231 231
                                   mbr.entries[i].numLBA, sectorsize);
... ...
@@ -566,7 +566,7 @@ static int msxml_parse_element(struct msxml_ctx *mxctx, xmlTextReaderPtr reader,
566 566
     return (virus ? CL_VIRUS : CL_SUCCESS);
567 567
 }
568 568
 
569
-/* reader intialization and closing handled by caller */
569
+/* reader initialization and closing handled by caller */
570 570
 int cli_msxml_parse_document(cli_ctx *ctx, xmlTextReaderPtr reader, const struct key_entry *keys, const size_t num_keys, uint32_t flags, struct msxml_ctx *mxctx)
571 571
 {
572 572
     struct msxml_ctx reserve;
... ...
@@ -663,7 +663,7 @@ int cli_msxml_parse_document(cli_ctx *ctx, xmlTextReaderPtr reader, const struct
663 663
     }
664 664
 #endif
665 665
 
666
-    /* non-critical return supression */
666
+    /* non-critical return suppression */
667 667
     if (ret == CL_ETIMEOUT || ret == CL_BREAK)
668 668
         ret = CL_SUCCESS;
669 669
 
... ...
@@ -272,7 +272,7 @@ struct cl_engine {
272 272
 				     * within a single archive
273 273
 				     */
274 274
     /* This is for structured data detection.  You can set the minimum
275
-     * number of occurences of an CC# or SSN before the system will
275
+     * number of occurrences of an CC# or SSN before the system will
276 276
      * generate a notification.
277 277
      */
278 278
     uint32_t min_cc_count;
... ...
@@ -990,7 +990,7 @@ struct pdf_array *pdf_parse_array(struct pdf_struct *pdf, struct pdf_obj *obj, s
990 990
                     break;
991 991
                 }
992 992
 
993
-                /* Not a dictionary. Intentially fall through. */
993
+                /* Not a dictionary. Intentionally fall through. */
994 994
             case '(':
995 995
                 val = pdf_parse_string(pdf, obj, begin, objsz, NULL, &begin, NULL);
996 996
                 begin += 2;
... ...
@@ -3166,13 +3166,13 @@ int cli_scanpe(cli_ctx *ctx)
3166 3166
     cli_dbgmsg("------------------------------------\n");
3167 3167
 
3168 3168
     if (DETECT_BROKEN_PE && !native && (!(pe_plus?EC32(optional_hdr64.SectionAlignment):EC32(optional_hdr32.SectionAlignment)) || (pe_plus?EC32(optional_hdr64.SectionAlignment):EC32(optional_hdr32.SectionAlignment))%0x1000)) {
3169
-        cli_dbgmsg("Bad virtual alignemnt\n");
3169
+        cli_dbgmsg("Bad virtual alignment\n");
3170 3170
         cli_append_virus(ctx,"Heuristics.Broken.Executable");
3171 3171
         return CL_VIRUS;
3172 3172
     }
3173 3173
 
3174 3174
     if (DETECT_BROKEN_PE && !native && (!(pe_plus?EC32(optional_hdr64.FileAlignment):EC32(optional_hdr32.FileAlignment)) || (pe_plus?EC32(optional_hdr64.FileAlignment):EC32(optional_hdr32.FileAlignment))%0x200)) {
3175
-        cli_dbgmsg("Bad file alignemnt\n");
3175
+        cli_dbgmsg("Bad file alignment\n");
3176 3176
         cli_append_virus(ctx, "Heuristics.Broken.Executable");
3177 3177
         return CL_VIRUS;
3178 3178
     }
... ...
@@ -68,7 +68,7 @@ static int add_static_pattern(struct regex_matcher *matcher, char* pattern);
68 68
 #define MATCH_FAILED  -1
69 69
 
70 70
 /*
71
- * Call this function when an unrecoverable error has occured, (instead of exit).
71
+ * Call this function when an unrecoverable error has occurred, (instead of exit).
72 72
  */
73 73
 static void fatal_error(struct regex_matcher* matcher)
74 74
 {
... ...
@@ -252,7 +252,7 @@ int regex_list_match(struct regex_matcher* matcher,char* real_url,const char* di
252 252
 
253 253
 
254 254
 /* Initialization & loading */
255
-/* Initializes @matcher, allocating necesarry substructures */
255
+/* Initializes @matcher, allocating necessary substructures */
256 256
 int init_regex_list(struct regex_matcher* matcher, uint8_t dconf_prefiltering)
257 257
 {
258 258
 #ifdef USE_MPOOL
... ...
@@ -1166,7 +1166,7 @@ expression
1166 1166
             yyscanner, OP_INCR_M, mem_offset + 2, NULL);
1167 1167
 
1168 1168
         // If next string is not undefined, go back to the
1169
-        // begining of the loop.
1169
+        // beginning of the loop.
1170 1170
         yr_parser_emit_with_arg_reloc(
1171 1171
             yyscanner,
1172 1172
             OP_JNUNDEF,