[{"data":1,"prerenderedAt":8231},["ShallowReactive",2],{"global-navigation":3,"page-\u002Fsei-cert-c-coding-standard\u002Frules\u002Ferror-handling-err\u002Ferr33-c":28,"surround-\u002Fsei-cert-c-coding-standard\u002Frules\u002Ferror-handling-err\u002Ferr33-c":6455,"sidebar-sei-cert-c-coding-standard":6462},[4,8],{"title":5,"path":6,"_path":6,"fromAppConfig":7},"Home","\u002F",true,{"title":9,"path":10,"children":11,"_path":27,"fromAppConfig":7},"Coding Standards","\u002Fcoding-standards\u002F",[12,15,18,21,24],{"title":13,"path":14},"Android Coding Standard","\u002Fandroid-secure-coding-standard\u002F",{"title":16,"path":17},"C Coding Standard","\u002Fsei-cert-c-coding-standard\u002F",{"title":19,"path":20},"C++ Coding Standard","\u002Fsei-cert-cpp-coding-standard\u002F",{"title":22,"path":23},"Java Coding Standard","\u002Fsei-cert-oracle-coding-standard-for-java\u002F",{"title":25,"path":26},"Perl Coding Standard","\u002Fsei-cert-perl-coding-standard\u002F","\u002Fcoding-standards",{"id":29,"title":30,"body":31,"description":6436,"extension":6437,"meta":6438,"navigation":7,"path":6451,"seo":6452,"stem":6453,"__hash__":6454},"content\u002F4.sei-cert-c-coding-standard\u002F03.rules\u002F08.error-handling-err\u002F4.err33-c.md","ERR33-C. Detect and handle standard library errors",{"type":32,"value":33,"toc":6402},"minimark",[34,38,53,56,62,2639,2650,2666,2676,2684,2690,2701,2709,2737,2928,2934,2943,3150,3156,3180,3511,3538,3543,3549,3834,3840,3855,3956,3966,3971,3984,4115,4121,4135,4223,4228,4237,4342,4348,4369,4498,4503,4515,4687,4696,4705,5104,5118,5122,5128,5141,5144,5149,5364,5400,5403,5454,5458,5470,5530,5535,6043,6047,6068,6080,6084,6091,6288,6292,6298,6302,6305,6310,6314,6374,6377,6398],[35,36,30],"h1",{"id":37},"err33-c-detect-and-handle-standard-library-errors",[39,40,41,42,47,48,52],"p",{},"The majority of the standard library functions, including I\u002FO functions and memory allocation functions, return either a valid value or a value of the correct return type that indicates an error (for example, −1 or a null pointer). Assuming that all calls to such functions will succeed and failing to check the return value for an indication of an error is a dangerous practice that may lead to ",[43,44,46],"a",{"href":45},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fbb-definitions#BB.Definitions-unexpectedbehavior","unexpected"," or ",[43,49,51],{"href":50},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fbb-definitions#BB.Definitions-undefinedbehavior","undefined behavior"," when an error occurs. It is essential that programs detect and appropriately handle all errors in accordance with an error-handling policy.",[39,54,55],{},"The successful completion or failure of each of the standard library functions listed in the following table shall be determined either by comparing the function’s return value with the value listed in the column labeled “Error Return” or by calling one of the library functions mentioned in the footnotes.",[39,57,58],{},[59,60,61],"strong",{},"Standard Library Functions",[63,64,65,78],"table",{},[66,67,68],"thead",{},[69,70,71,74,76],"tr",{},[72,73],"th",{},[72,75],{},[72,77],{},[79,80,81,93,109,124,137,150,164,177,192,207,220,233,248,265,284,299,317,332,345,362,377,397,414,428,444,458,471,484,495,512,526,540,553,565,578,591,605,618,631,646,664,676,687,699,712,725,740,755,768,781,794,807,820,834,847,860,873,886,900,914,930,945,960,976,989,1002,1015,1028,1042,1057,1072,1087,1104,1122,1137,1148,1163,1176,1189,1202,1215,1228,1241,1254,1267,1280,1297,1309,1320,1332,1343,1356,1369,1382,1395,1410,1423,1436,1450,1467,1482,1501,1515,1528,1547,1561,1580,1596,1612,1628,1643,1655,1666,1679,1692,1709,1724,1739,1752,1765,1779,1792,1805,1819,1832,1847,1861,1876,1896,1909,1920,1931,1944,1957,1968,1979,1992,2005,2016,2029,2042,2053,2064,2076,2087,2100,2113,2124,2135,2148,2161,2172,2185,2198,2212,2226,2239,2252,2265,2281,2294,2308,2323,2338,2355,2369,2382,2399,2414,2431,2444,2457,2472,2487,2502,2516,2530,2543,2556,2573,2589,2602,2613,2626],"tbody",{},[69,82,83,87,90],{},[84,85,86],"td",{},"Function",[84,88,89],{},"Successful Return",[84,91,92],{},"Error Return",[69,94,95,101,104],{},[84,96,97],{},[98,99,100],"code",{},"      aligned_alloc       ()     ",[84,102,103],{},"Pointer to space",[84,105,106],{},[98,107,108],{},"NULL",[69,110,111,116,121],{},[84,112,113],{},[98,114,115],{},"      asctime_s       ()     ",[84,117,118],{},[98,119,120],{},"      0     ",[84,122,123],{},"Nonzero",[69,125,126,131,135],{},[84,127,128],{},[98,129,130],{},"      at_quick_exit       ()     ",[84,132,133],{},[98,134,120],{},[84,136,123],{},[69,138,139,144,148],{},[84,140,141],{},[98,142,143],{},"      atexit       ()     ",[84,145,146],{},[98,147,120],{},[84,149,123],{},[69,151,152,157,160],{},[84,153,154],{},[98,155,156],{},"      bsearch       ()     ",[84,158,159],{},"Pointer to matching element",[84,161,162],{},[98,163,108],{},[69,165,166,171,173],{},[84,167,168],{},[98,169,170],{},"      bsearch_s       ()     ",[84,172,159],{},[84,174,175],{},[98,176,108],{},[69,178,179,184,187],{},[84,180,181],{},[98,182,183],{},"      btowc       ()     ",[84,185,186],{},"Converted wide character",[84,188,189],{},[98,190,191],{},"WEOF",[69,193,194,199,202],{},[84,195,196],{},[98,197,198],{},"      c16rtomb       ()     ",[84,200,201],{},"Number of bytes",[84,203,204],{},[98,205,206],{},"(size_t)(-1)",[69,208,209,214,216],{},[84,210,211],{},[98,212,213],{},"      c32rtomb       ()     ",[84,215,201],{},[84,217,218],{},[98,219,206],{},[69,221,222,227,229],{},[84,223,224],{},[98,225,226],{},"      calloc       ()     ",[84,228,103],{},[84,230,231],{},[98,232,108],{},[69,234,235,240,243],{},[84,236,237],{},[98,238,239],{},"      clock       ()     ",[84,241,242],{},"Processor time",[84,244,245],{},[98,246,247],{},"(clock_t)(-1)",[69,249,250,255,260],{},[84,251,252],{},[98,253,254],{},"      cnd_broadcast       ()     ",[84,256,257],{},[98,258,259],{},"      thrd_success     ",[84,261,262],{},[98,263,264],{},"      thrd_error     ",[69,266,267,272,276],{},[84,268,269],{},[98,270,271],{},"      cnd_init       ()     ",[84,273,274],{},[98,275,259],{},[84,277,278,281,282],{},[98,279,280],{},"      thrd_nomem     ","or",[98,283,264],{},[69,285,286,291,295],{},[84,287,288],{},[98,289,290],{},"      cnd_signal       ()     ",[84,292,293],{},[98,294,259],{},[84,296,297],{},[98,298,264],{},[69,300,301,306,310],{},[84,302,303],{},[98,304,305],{},"      cnd_timedwait       ()     ",[84,307,308],{},[98,309,259],{},[84,311,312,281,315],{},[98,313,314],{},"      thrd_timedout     ",[98,316,264],{},[69,318,319,324,328],{},[84,320,321],{},[98,322,323],{},"      cnd_wait       ()     ",[84,325,326],{},[98,327,259],{},[84,329,330],{},[98,331,264],{},[69,333,334,339,343],{},[84,335,336],{},[98,337,338],{},"      ctime_s       ()     ",[84,340,341],{},[98,342,120],{},[84,344,123],{},[69,346,347,352,356],{},[84,348,349],{},[98,350,351],{},"      fclose       ()     ",[84,353,354],{},[98,355,120],{},[84,357,358,361],{},[98,359,360],{},"      EOF     "," (negative)",[69,363,364,369,373],{},[84,365,366],{},[98,367,368],{},"      fflush       ()     ",[84,370,371],{},[98,372,120],{},[84,374,375,361],{},[98,376,360],{},[69,378,379,384,387],{},[84,380,381],{},[98,382,383],{},"      fgetc       ()     ",[84,385,386],{},"Character read",[84,388,389,392,393],{},[98,390,391],{},"EOF"," ",[394,395,396],"sup",{},"1",[69,398,399,404,408],{},[84,400,401],{},[98,402,403],{},"      fgetpos       ()     ",[84,405,406],{},[98,407,120],{},[84,409,410,411],{},"Nonzero, ",[98,412,413],{},"      errno > 0     ",[69,415,416,421,424],{},[84,417,418],{},[98,419,420],{},"      fgets       ()     ",[84,422,423],{},"Pointer to string",[84,425,426],{},[98,427,108],{},[69,429,430,435,438],{},[84,431,432],{},[98,433,434],{},"      fgetwc       ()     ",[84,436,437],{},"Wide character read",[84,439,440,392,442],{},[98,441,191],{},[394,443,396],{},[69,445,446,451,454],{},[84,447,448],{},[98,449,450],{},"      fopen       ()     ",[84,452,453],{},"Pointer to stream",[84,455,456],{},[98,457,108],{},[69,459,460,465,469],{},[84,461,462],{},[98,463,464],{},"      fopen_s       ()     ",[84,466,467],{},[98,468,120],{},[84,470,123],{},[69,472,473,478,481],{},[84,474,475],{},[98,476,477],{},"      fprintf       ()     ",[84,479,480],{},"Number of characters (nonnegative)",[84,482,483],{},"Negative",[69,485,486,491,493],{},[84,487,488],{},[98,489,490],{},"      fprintf_s       ()     ",[84,492,480],{},[84,494,483],{},[69,496,497,502,505],{},[84,498,499],{},[98,500,501],{},"      fputc       ()     ",[84,503,504],{},"Character written",[84,506,507,392,509],{},[98,508,391],{},[394,510,511],{},"2",[69,513,514,519,522],{},[84,515,516],{},[98,517,518],{},"      fputs       ()     ",[84,520,521],{},"Nonnegative",[84,523,524,361],{},[98,525,391],{},[69,527,528,533,536],{},[84,529,530],{},[98,531,532],{},"fputwc()",[84,534,535],{},"Wide character written",[84,537,538],{},[98,539,191],{},[69,541,542,547,549],{},[84,543,544],{},[98,545,546],{},"      fputws       ()     ",[84,548,521],{},[84,550,551,361],{},[98,552,391],{},[69,554,555,560,563],{},[84,556,557],{},[98,558,559],{},"      fread       ()     ",[84,561,562],{},"Elements read",[84,564,562],{},[69,566,567,572,574],{},[84,568,569],{},[98,570,571],{},"      freopen       ()     ",[84,573,453],{},[84,575,576],{},[98,577,108],{},[69,579,580,585,589],{},[84,581,582],{},[98,583,584],{},"      freopen_s       ()     ",[84,586,587],{},[98,588,120],{},[84,590,123],{},[69,592,593,598,601],{},[84,594,595],{},[98,596,597],{},"      fscanf       ()     ",[84,599,600],{},"Number of conversions (nonnegative)",[84,602,603,361],{},[98,604,391],{},[69,606,607,612,614],{},[84,608,609],{},[98,610,611],{},"      fscanf_s       ()     ",[84,613,600],{},[84,615,616,361],{},[98,617,391],{},[69,619,620,625,629],{},[84,621,622],{},[98,623,624],{},"      fseek       ()     ",[84,626,627],{},[98,628,120],{},[84,630,123],{},[69,632,633,638,642],{},[84,634,635],{},[98,636,637],{},"      fsetpos       ()     ",[84,639,640],{},[98,641,120],{},[84,643,410,644],{},[98,645,413],{},[69,647,648,653,656],{},[84,649,650],{},[98,651,652],{},"      ftell       ()     ",[84,654,655],{},"File position",[84,657,658,661,662],{},[98,659,660],{},"−1L"," , ",[98,663,413],{},[69,665,666,671,674],{},[84,667,668],{},[98,669,670],{},"      fwprintf       ()     ",[84,672,673],{},"Number of wide characters (nonnegative)",[84,675,483],{},[69,677,678,683,685],{},[84,679,680],{},[98,681,682],{},"      fwprintf_s       ()     ",[84,684,673],{},[84,686,483],{},[69,688,689,694,697],{},[84,690,691],{},[98,692,693],{},"      fwrite       ()     ",[84,695,696],{},"Elements written",[84,698,696],{},[69,700,701,706,708],{},[84,702,703],{},[98,704,705],{},"      fwscanf       ()     ",[84,707,600],{},[84,709,710,361],{},[98,711,391],{},[69,713,714,719,721],{},[84,715,716],{},[98,717,718],{},"      fwscanf_s       ()     ",[84,720,600],{},[84,722,723,361],{},[98,724,391],{},[69,726,727,732,734],{},[84,728,729],{},[98,730,731],{},"      getc       ()     ",[84,733,386],{},[84,735,736,392,738],{},[98,737,391],{},[394,739,396],{},[69,741,742,747,749],{},[84,743,744],{},[98,745,746],{},"      getchar       ()     ",[84,748,386],{},[84,750,751,392,753],{},[98,752,391],{},[394,754,396],{},[69,756,757,762,764],{},[84,758,759],{},[98,760,761],{},"      getenv       ()     ",[84,763,423],{},[84,765,766],{},[98,767,108],{},[69,769,770,775,777],{},[84,771,772],{},[98,773,774],{},"      getenv_s       ()     ",[84,776,423],{},[84,778,779],{},[98,780,108],{},[69,782,783,788,790],{},[84,784,785],{},[98,786,787],{},"      gets_s       ()     ",[84,789,423],{},[84,791,792],{},[98,793,108],{},[69,795,796,801,803],{},[84,797,798],{},[98,799,800],{},"      getwc       ()     ",[84,802,437],{},[84,804,805],{},[98,806,191],{},[69,808,809,814,816],{},[84,810,811],{},[98,812,813],{},"      getwchar       ()     ",[84,815,437],{},[84,817,818],{},[98,819,191],{},[69,821,822,827,830],{},[84,823,824],{},[98,825,826],{},"      gmtime       ()     ",[84,828,829],{},"Pointer to broken-down time",[84,831,832],{},[98,833,108],{},[69,835,836,841,843],{},[84,837,838],{},[98,839,840],{},"      gmtime_s       ()     ",[84,842,829],{},[84,844,845],{},[98,846,108],{},[69,848,849,854,856],{},[84,850,851],{},[98,852,853],{},"      localtime       ()     ",[84,855,829],{},[84,857,858],{},[98,859,108],{},[69,861,862,867,869],{},[84,863,864],{},[98,865,866],{},"      localtime_s       ()     ",[84,868,829],{},[84,870,871],{},[98,872,108],{},[69,874,875,880,882],{},[84,876,877],{},[98,878,879],{},"      malloc       ()     ",[84,881,103],{},[84,883,884],{},[98,885,108],{},[69,887,888,893,895],{},[84,889,890],{},[98,891,892],{},"      mblen       ()       , s != NULL     ",[84,894,201],{},[84,896,897],{},[98,898,899],{},"−1",[69,901,902,907,910],{},[84,903,904],{},[98,905,906],{},"      mbrlen       ()       , s != NULL     ",[84,908,909],{},"Number of bytes or status",[84,911,912],{},[98,913,206],{},[69,915,916,921,923],{},[84,917,918],{},[98,919,920],{},"      mbrtoc16       ()     ",[84,922,909],{},[84,924,925,661,927],{},[98,926,206],{},[98,928,929],{},"      errno == EILSEQ     ",[69,931,932,937,939],{},[84,933,934],{},[98,935,936],{},"      mbrtoc32       ()     ",[84,938,909],{},[84,940,941,661,943],{},[98,942,206],{},[98,944,929],{},[69,946,947,952,954],{},[84,948,949],{},[98,950,951],{},"      mbrtowc       ()       , s != NULL     ",[84,953,909],{},[84,955,956,661,958],{},[98,957,206],{},[98,959,929],{},[69,961,962,967,970],{},[84,963,964],{},[98,965,966],{},"      mbsrtowcs       ()     ",[84,968,969],{},"Number of non-null elements",[84,971,972,661,974],{},[98,973,206],{},[98,975,929],{},[69,977,978,983,987],{},[84,979,980],{},[98,981,982],{},"      mbsrtowcs_s       ()     ",[84,984,985],{},[98,986,120],{},[84,988,123],{},[69,990,991,996,998],{},[84,992,993],{},[98,994,995],{},"      mbstowcs       ()     ",[84,997,969],{},[84,999,1000],{},[98,1001,206],{},[69,1003,1004,1009,1013],{},[84,1005,1006],{},[98,1007,1008],{},"      mbstowcs_s       ()     ",[84,1010,1011],{},[98,1012,120],{},[84,1014,123],{},[69,1016,1017,1022,1024],{},[84,1018,1019],{},[98,1020,1021],{},"      mbtowc       ()       , s != NULL     ",[84,1023,201],{},[84,1025,1026],{},[98,1027,899],{},[69,1029,1030,1035,1038],{},[84,1031,1032],{},[98,1033,1034],{},"      memchr       ()     ",[84,1036,1037],{},"Pointer to located character",[84,1039,1040],{},[98,1041,108],{},[69,1043,1044,1049,1052],{},[84,1045,1046],{},[98,1047,1048],{},"      mktime       ()     ",[84,1050,1051],{},"Calendar time",[84,1053,1054],{},[98,1055,1056],{},"(time_t)(-1)",[69,1058,1059,1064,1068],{},[84,1060,1061],{},[98,1062,1063],{},"      mtx_init       ()     ",[84,1065,1066],{},[98,1067,259],{},[84,1069,1070],{},[98,1071,264],{},[69,1073,1074,1079,1083],{},[84,1075,1076],{},[98,1077,1078],{},"      mtx_lock       ()     ",[84,1080,1081],{},[98,1082,259],{},[84,1084,1085],{},[98,1086,264],{},[69,1088,1089,1094,1098],{},[84,1090,1091],{},[98,1092,1093],{},"      mtx_timedlock       ()     ",[84,1095,1096],{},[98,1097,259],{},[84,1099,1100,281,1102],{},[98,1101,314],{},[98,1103,264],{},[69,1105,1106,1111,1115],{},[84,1107,1108],{},[98,1109,1110],{},"      mtx_trylock       ()     ",[84,1112,1113],{},[98,1114,259],{},[84,1116,1117,281,1120],{},[98,1118,1119],{},"      thrd_busy     ",[98,1121,264],{},[69,1123,1124,1129,1133],{},[84,1125,1126],{},[98,1127,1128],{},"      mtx_unlock       ()     ",[84,1130,1131],{},[98,1132,259],{},[84,1134,1135],{},[98,1136,264],{},[69,1138,1139,1144,1146],{},[84,1140,1141],{},[98,1142,1143],{},"      printf_s       ()     ",[84,1145,480],{},[84,1147,483],{},[69,1149,1150,1155,1157],{},[84,1151,1152],{},[98,1153,1154],{},"      putc       ()     ",[84,1156,504],{},[84,1158,1159,392,1161],{},[98,1160,391],{},[394,1162,511],{},[69,1164,1165,1170,1172],{},[84,1166,1167],{},[98,1168,1169],{},"      putwc       ()     ",[84,1171,535],{},[84,1173,1174],{},[98,1175,191],{},[69,1177,1178,1183,1187],{},[84,1179,1180],{},[98,1181,1182],{},"      raise       ()     ",[84,1184,1185],{},[98,1186,120],{},[84,1188,123],{},[69,1190,1191,1196,1198],{},[84,1192,1193],{},[98,1194,1195],{},"      realloc       ()     ",[84,1197,103],{},[84,1199,1200],{},[98,1201,108],{},[69,1203,1204,1209,1213],{},[84,1205,1206],{},[98,1207,1208],{},"      remove       ()     ",[84,1210,1211],{},[98,1212,120],{},[84,1214,123],{},[69,1216,1217,1222,1226],{},[84,1218,1219],{},[98,1220,1221],{},"      rename       ()     ",[84,1223,1224],{},[98,1225,120],{},[84,1227,123],{},[69,1229,1230,1235,1237],{},[84,1231,1232],{},[98,1233,1234],{},"      setlocale       ()     ",[84,1236,423],{},[84,1238,1239],{},[98,1240,108],{},[69,1242,1243,1248,1252],{},[84,1244,1245],{},[98,1246,1247],{},"      setvbuf       ()     ",[84,1249,1250],{},[98,1251,120],{},[84,1253,123],{},[69,1255,1256,1261,1263],{},[84,1257,1258],{},[98,1259,1260],{},"      scanf       ()     ",[84,1262,600],{},[84,1264,1265,361],{},[98,1266,391],{},[69,1268,1269,1274,1276],{},[84,1270,1271],{},[98,1272,1273],{},"      scanf_s       ()     ",[84,1275,600],{},[84,1277,1278,361],{},[98,1279,391],{},[69,1281,1282,1287,1290],{},[84,1283,1284],{},[98,1285,1286],{},"      signal       ()     ",[84,1288,1289],{},"Pointer to previous function",[84,1291,1292,661,1295],{},[98,1293,1294],{},"SIG_ERR",[98,1296,413],{},[69,1298,1299,1304,1307],{},[84,1300,1301],{},[98,1302,1303],{},"      snprintf       ()     ",[84,1305,1306],{},"Number of characters that would be written (nonnegative)",[84,1308,483],{},[69,1310,1311,1316,1318],{},[84,1312,1313],{},[98,1314,1315],{},"      snprintf_s       ()     ",[84,1317,1306],{},[84,1319,483],{},[69,1321,1322,1327,1330],{},[84,1323,1324],{},[98,1325,1326],{},"      sprintf       ()     ",[84,1328,1329],{},"Number of non-null characters written",[84,1331,483],{},[69,1333,1334,1339,1341],{},[84,1335,1336],{},[98,1337,1338],{},"      sprintf_s       ()     ",[84,1340,1329],{},[84,1342,483],{},[69,1344,1345,1350,1352],{},[84,1346,1347],{},[98,1348,1349],{},"      sscanf       ()     ",[84,1351,600],{},[84,1353,1354,361],{},[98,1355,391],{},[69,1357,1358,1363,1365],{},[84,1359,1360],{},[98,1361,1362],{},"      sscanf_s       ()     ",[84,1364,600],{},[84,1366,1367,361],{},[98,1368,391],{},[69,1370,1371,1376,1378],{},[84,1372,1373],{},[98,1374,1375],{},"      strchr       ()     ",[84,1377,1037],{},[84,1379,1380],{},[98,1381,108],{},[69,1383,1384,1389,1393],{},[84,1385,1386],{},[98,1387,1388],{},"      strerror_s       ()     ",[84,1390,1391],{},[98,1392,120],{},[84,1394,123],{},[69,1396,1397,1402,1405],{},[84,1398,1399],{},[98,1400,1401],{},"      strftime       ()     ",[84,1403,1404],{},"Number of non-null characters",[84,1406,1407],{},[98,1408,1409],{},"0",[69,1411,1412,1417,1419],{},[84,1413,1414],{},[98,1415,1416],{},"      strpbrk       ()     ",[84,1418,1037],{},[84,1420,1421],{},[98,1422,108],{},[69,1424,1425,1430,1432],{},[84,1426,1427],{},[98,1428,1429],{},"      strrchr       ()     ",[84,1431,1037],{},[84,1433,1434],{},[98,1435,108],{},[69,1437,1438,1443,1446],{},[84,1439,1440],{},[98,1441,1442],{},"      strstr       ()     ",[84,1444,1445],{},"Pointer to located string",[84,1447,1448],{},[98,1449,108],{},[69,1451,1452,1457,1460],{},[84,1453,1454],{},[98,1455,1456],{},"      strtod       ()     ",[84,1458,1459],{},"Converted value",[84,1461,1462,661,1464],{},[98,1463,1409],{},[98,1465,1466],{},"      errno == ERANGE     ",[69,1468,1469,1474,1476],{},[84,1470,1471],{},[98,1472,1473],{},"      strtof       ()     ",[84,1475,1459],{},[84,1477,1478,661,1480],{},[98,1479,1409],{},[98,1481,1466],{},[69,1483,1484,1489,1491],{},[84,1485,1486],{},[98,1487,1488],{},"      strtoimax       ()     ",[84,1490,1459],{},[84,1492,1493,47,1496,661,1499],{},[98,1494,1495],{},"INTMAX_MAX",[98,1497,1498],{},"INTMAX_MIN",[98,1500,1466],{},[69,1502,1503,1508,1511],{},[84,1504,1505],{},[98,1506,1507],{},"      strtok       ()     ",[84,1509,1510],{},"Pointer to first character of a token",[84,1512,1513],{},[98,1514,108],{},[69,1516,1517,1522,1524],{},[84,1518,1519],{},[98,1520,1521],{},"      strtok_s       ()     ",[84,1523,1510],{},[84,1525,1526],{},[98,1527,108],{},[69,1529,1530,1535,1537],{},[84,1531,1532],{},[98,1533,1534],{},"      strtol       ()     ",[84,1536,1459],{},[84,1538,1539,47,1542,661,1545],{},[98,1540,1541],{},"LONG_MAX",[98,1543,1544],{},"LONG_MIN",[98,1546,1466],{},[69,1548,1549,1554,1556],{},[84,1550,1551],{},[98,1552,1553],{},"      strtold       ()     ",[84,1555,1459],{},[84,1557,1558],{},[98,1559,1560],{},"      0, errno == ERANGE     ",[69,1562,1563,1568,1570],{},[84,1564,1565],{},[98,1566,1567],{},"      strtoll       ()     ",[84,1569,1459],{},[84,1571,1572,47,1575,661,1578],{},[98,1573,1574],{},"LLONG_MAX",[98,1576,1577],{},"LLONG_MIN",[98,1579,1466],{},[69,1581,1582,1587,1589],{},[84,1583,1584],{},[98,1585,1586],{},"      strtoumax       ()     ",[84,1588,1459],{},[84,1590,1591,661,1594],{},[98,1592,1593],{},"UINTMAX_MAX",[98,1595,1466],{},[69,1597,1598,1603,1605],{},[84,1599,1600],{},[98,1601,1602],{},"      strtoul       ()     ",[84,1604,1459],{},[84,1606,1607,661,1610],{},[98,1608,1609],{},"ULONG_MAX",[98,1611,1466],{},[69,1613,1614,1619,1621],{},[84,1615,1616],{},[98,1617,1618],{},"      strtoull       ()     ",[84,1620,1459],{},[84,1622,1623,661,1626],{},[98,1624,1625],{},"ULLONG_MAX",[98,1627,1466],{},[69,1629,1630,1635,1638],{},[84,1631,1632],{},[98,1633,1634],{},"      strxfrm       ()     ",[84,1636,1637],{},"Length of transformed string",[84,1639,1640],{},[98,1641,1642],{},"      >= n     ",[69,1644,1645,1650,1653],{},[84,1646,1647],{},[98,1648,1649],{},"      swprintf       ()     ",[84,1651,1652],{},"Number of non-null wide characters",[84,1654,483],{},[69,1656,1657,1662,1664],{},[84,1658,1659],{},[98,1660,1661],{},"      swprintf_s       ()     ",[84,1663,1652],{},[84,1665,483],{},[69,1667,1668,1673,1675],{},[84,1669,1670],{},[98,1671,1672],{},"      swscanf       ()     ",[84,1674,600],{},[84,1676,1677,361],{},[98,1678,391],{},[69,1680,1681,1686,1688],{},[84,1682,1683],{},[98,1684,1685],{},"      swscanf_s       ()     ",[84,1687,600],{},[84,1689,1690,361],{},[98,1691,391],{},[69,1693,1694,1699,1703],{},[84,1695,1696],{},[98,1697,1698],{},"      thrd_create       ()     ",[84,1700,1701],{},[98,1702,259],{},[84,1704,1705,281,1707],{},[98,1706,280],{},[98,1708,264],{},[69,1710,1711,1716,1720],{},[84,1712,1713],{},[98,1714,1715],{},"      thrd_detach       ()     ",[84,1717,1718],{},[98,1719,259],{},[84,1721,1722],{},[98,1723,264],{},[69,1725,1726,1731,1735],{},[84,1727,1728],{},[98,1729,1730],{},"      thrd_join       ()     ",[84,1732,1733],{},[98,1734,259],{},[84,1736,1737],{},[98,1738,264],{},[69,1740,1741,1746,1750],{},[84,1742,1743],{},[98,1744,1745],{},"      thrd_sleep       ()     ",[84,1747,1748],{},[98,1749,120],{},[84,1751,483],{},[69,1753,1754,1759,1761],{},[84,1755,1756],{},[98,1757,1758],{},"      time       ()     ",[84,1760,1051],{},[84,1762,1763],{},[98,1764,1056],{},[69,1766,1767,1772,1775],{},[84,1768,1769],{},[98,1770,1771],{},"      timespec_get       ()     ",[84,1773,1774],{},"Base",[84,1776,1777],{},[98,1778,1409],{},[69,1780,1781,1786,1788],{},[84,1782,1783],{},[98,1784,1785],{},"      tmpfile       ()     ",[84,1787,453],{},[84,1789,1790],{},[98,1791,108],{},[69,1793,1794,1799,1803],{},[84,1795,1796],{},[98,1797,1798],{},"      tmpfile_s       ()     ",[84,1800,1801],{},[98,1802,120],{},[84,1804,123],{},[69,1806,1807,1812,1815],{},[84,1808,1809],{},[98,1810,1811],{},"      tmpnam       ()     ",[84,1813,1814],{},"Non-null pointer",[84,1816,1817],{},[98,1818,108],{},[69,1820,1821,1826,1830],{},[84,1822,1823],{},[98,1824,1825],{},"      tmpnam_s       ()     ",[84,1827,1828],{},[98,1829,120],{},[84,1831,123],{},[69,1833,1834,1839,1843],{},[84,1835,1836],{},[98,1837,1838],{},"      tss_create       ()     ",[84,1840,1841],{},[98,1842,259],{},[84,1844,1845],{},[98,1846,264],{},[69,1848,1849,1854,1857],{},[84,1850,1851],{},[98,1852,1853],{},"      tss_get       ()     ",[84,1855,1856],{},"Value of thread-specific storage",[84,1858,1859],{},[98,1860,1409],{},[69,1862,1863,1868,1872],{},[84,1864,1865],{},[98,1866,1867],{},"      tss_set       ()     ",[84,1869,1870],{},[98,1871,259],{},[84,1873,1874],{},[98,1875,264],{},[69,1877,1878,1883,1886],{},[84,1879,1880],{},[98,1881,1882],{},"      ungetc       ()     ",[84,1884,1885],{},"Character pushed back",[84,1887,1888,1890,1891,1895],{},[98,1889,391],{}," (see ",[43,1892,1894],{"href":1893},"file:\u002F\u002F\u002FC:\u002FUsers\u002Fpjumde\u002FDesktop\u002FTS_17961_2013-11-01.doc#Failuretodetectandhandlestandardlibrary","below"," )",[69,1897,1898,1903,1905],{},[84,1899,1900],{},[98,1901,1902],{},"      ungetwc       ()     ",[84,1904,1885],{},[84,1906,1907],{},[98,1908,191],{},[69,1910,1911,1916,1918],{},[84,1912,1913],{},[98,1914,1915],{},"      vfprintf       ()     ",[84,1917,480],{},[84,1919,483],{},[69,1921,1922,1927,1929],{},[84,1923,1924],{},[98,1925,1926],{},"      vfprintf_s       ()     ",[84,1928,480],{},[84,1930,483],{},[69,1932,1933,1938,1940],{},[84,1934,1935],{},[98,1936,1937],{},"      vfscanf       ()     ",[84,1939,600],{},[84,1941,1942,361],{},[98,1943,391],{},[69,1945,1946,1951,1953],{},[84,1947,1948],{},[98,1949,1950],{},"      vfscanf_s       ()     ",[84,1952,600],{},[84,1954,1955,361],{},[98,1956,391],{},[69,1958,1959,1964,1966],{},[84,1960,1961],{},[98,1962,1963],{},"      vfwprintf       ()     ",[84,1965,673],{},[84,1967,483],{},[69,1969,1970,1975,1977],{},[84,1971,1972],{},[98,1973,1974],{},"      vfwprintf_s       ()     ",[84,1976,673],{},[84,1978,483],{},[69,1980,1981,1986,1988],{},[84,1982,1983],{},[98,1984,1985],{},"      vfwscanf       ()     ",[84,1987,600],{},[84,1989,1990,361],{},[98,1991,391],{},[69,1993,1994,1999,2001],{},[84,1995,1996],{},[98,1997,1998],{},"      vfwscanf_s       ()     ",[84,2000,600],{},[84,2002,2003,361],{},[98,2004,391],{},[69,2006,2007,2012,2014],{},[84,2008,2009],{},[98,2010,2011],{},"      vprintf_s       ()     ",[84,2013,480],{},[84,2015,483],{},[69,2017,2018,2023,2025],{},[84,2019,2020],{},[98,2021,2022],{},"      vscanf       ()     ",[84,2024,600],{},[84,2026,2027,361],{},[98,2028,391],{},[69,2030,2031,2036,2038],{},[84,2032,2033],{},[98,2034,2035],{},"      vscanf_s       ()     ",[84,2037,600],{},[84,2039,2040,361],{},[98,2041,391],{},[69,2043,2044,2049,2051],{},[84,2045,2046],{},[98,2047,2048],{},"      vsnprintf       ()     ",[84,2050,1306],{},[84,2052,483],{},[69,2054,2055,2060,2062],{},[84,2056,2057],{},[98,2058,2059],{},"      vsnprintf_s       ()     ",[84,2061,1306],{},[84,2063,483],{},[69,2065,2066,2071,2074],{},[84,2067,2068],{},[98,2069,2070],{},"      vsprintf       ()     ",[84,2072,2073],{},"Number of non-null characters (nonnegative)",[84,2075,483],{},[69,2077,2078,2083,2085],{},[84,2079,2080],{},[98,2081,2082],{},"      vsprintf_s       ()     ",[84,2084,2073],{},[84,2086,483],{},[69,2088,2089,2094,2096],{},[84,2090,2091],{},[98,2092,2093],{},"      vsscanf       ()     ",[84,2095,600],{},[84,2097,2098,361],{},[98,2099,391],{},[69,2101,2102,2107,2109],{},[84,2103,2104],{},[98,2105,2106],{},"      vsscanf_s       ()     ",[84,2108,600],{},[84,2110,2111,361],{},[98,2112,391],{},[69,2114,2115,2120,2122],{},[84,2116,2117],{},[98,2118,2119],{},"      vswprintf       ()     ",[84,2121,1652],{},[84,2123,483],{},[69,2125,2126,2131,2133],{},[84,2127,2128],{},[98,2129,2130],{},"      vswprintf_s       ()     ",[84,2132,1652],{},[84,2134,483],{},[69,2136,2137,2142,2144],{},[84,2138,2139],{},[98,2140,2141],{},"      vswscanf       ()     ",[84,2143,600],{},[84,2145,2146,361],{},[98,2147,391],{},[69,2149,2150,2155,2157],{},[84,2151,2152],{},[98,2153,2154],{},"      vswscanf_s       ()     ",[84,2156,600],{},[84,2158,2159,361],{},[98,2160,391],{},[69,2162,2163,2168,2170],{},[84,2164,2165],{},[98,2166,2167],{},"      vwprintf_s       ()     ",[84,2169,673],{},[84,2171,483],{},[69,2173,2174,2179,2181],{},[84,2175,2176],{},[98,2177,2178],{},"      vwscanf       ()     ",[84,2180,600],{},[84,2182,2183,361],{},[98,2184,391],{},[69,2186,2187,2192,2194],{},[84,2188,2189],{},[98,2190,2191],{},"      vwscanf_s       ()     ",[84,2193,600],{},[84,2195,2196,361],{},[98,2197,391],{},[69,2199,2200,2205,2208],{},[84,2201,2202],{},[98,2203,2204],{},"      wcrtomb       ()     ",[84,2206,2207],{},"Number of bytes stored",[84,2209,2210],{},[98,2211,206],{},[69,2213,2214,2219,2222],{},[84,2215,2216],{},[98,2217,2218],{},"      wcschr       ()     ",[84,2220,2221],{},"Pointer to located wide character",[84,2223,2224],{},[98,2225,108],{},[69,2227,2228,2233,2235],{},[84,2229,2230],{},[98,2231,2232],{},"      wcsftime       ()     ",[84,2234,1652],{},[84,2236,2237],{},[98,2238,1409],{},[69,2240,2241,2246,2248],{},[84,2242,2243],{},[98,2244,2245],{},"      wcspbrk       ()     ",[84,2247,2221],{},[84,2249,2250],{},[98,2251,108],{},[69,2253,2254,2259,2261],{},[84,2255,2256],{},[98,2257,2258],{},"      wcsrchr       ()     ",[84,2260,2221],{},[84,2262,2263],{},[98,2264,108],{},[69,2266,2267,2272,2275],{},[84,2268,2269],{},[98,2270,2271],{},"      wcsrtombs       ()     ",[84,2273,2274],{},"Number of non-null bytes",[84,2276,2277,661,2279],{},[98,2278,206],{},[98,2280,929],{},[69,2282,2283,2288,2292],{},[84,2284,2285],{},[98,2286,2287],{},"      wcsrtombs_s       ()     ",[84,2289,2290],{},[98,2291,120],{},[84,2293,123],{},[69,2295,2296,2301,2304],{},[84,2297,2298],{},[98,2299,2300],{},"      wcsstr       ()     ",[84,2302,2303],{},"Pointer to located wide string",[84,2305,2306],{},[98,2307,108],{},[69,2309,2310,2315,2317],{},[84,2311,2312],{},[98,2313,2314],{},"      wcstod       ()     ",[84,2316,1459],{},[84,2318,2319,661,2321],{},[98,2320,1409],{},[98,2322,1466],{},[69,2324,2325,2330,2332],{},[84,2326,2327],{},[98,2328,2329],{},"      wcstof       ()     ",[84,2331,1459],{},[84,2333,2334,661,2336],{},[98,2335,1409],{},[98,2337,1466],{},[69,2339,2340,2345,2347],{},[84,2341,2342],{},[98,2343,2344],{},"      wcstoimax       ()     ",[84,2346,1459],{},[84,2348,2349,47,2351,661,2353],{},[98,2350,1495],{},[98,2352,1498],{},[98,2354,1466],{},[69,2356,2357,2362,2365],{},[84,2358,2359],{},[98,2360,2361],{},"      wcstok       ()     ",[84,2363,2364],{},"Pointer to first wide character of a token",[84,2366,2367],{},[98,2368,108],{},[69,2370,2371,2376,2378],{},[84,2372,2373],{},[98,2374,2375],{},"      wcstok_s       ()     ",[84,2377,2364],{},[84,2379,2380],{},[98,2381,108],{},[69,2383,2384,2389,2391],{},[84,2385,2386],{},[98,2387,2388],{},"      wcstol       ()     ",[84,2390,1459],{},[84,2392,2393,47,2395,661,2397],{},[98,2394,1541],{},[98,2396,1544],{},[98,2398,1466],{},[69,2400,2401,2406,2408],{},[84,2402,2403],{},[98,2404,2405],{},"      wcstold       ()     ",[84,2407,1459],{},[84,2409,2410,661,2412],{},[98,2411,1409],{},[98,2413,1466],{},[69,2415,2416,2421,2423],{},[84,2417,2418],{},[98,2419,2420],{},"      wcstoll       ()     ",[84,2422,1459],{},[84,2424,2425,47,2427,661,2429],{},[98,2426,1574],{},[98,2428,1577],{},[98,2430,1466],{},[69,2432,2433,2438,2440],{},[84,2434,2435],{},[98,2436,2437],{},"      wcstombs       ()     ",[84,2439,2274],{},[84,2441,2442],{},[98,2443,206],{},[69,2445,2446,2451,2455],{},[84,2447,2448],{},[98,2449,2450],{},"      wcstombs_s       ()     ",[84,2452,2453],{},[98,2454,120],{},[84,2456,123],{},[69,2458,2459,2464,2466],{},[84,2460,2461],{},[98,2462,2463],{},"      wcstoumax       ()     ",[84,2465,1459],{},[84,2467,2468,661,2470],{},[98,2469,1593],{},[98,2471,1466],{},[69,2473,2474,2479,2481],{},[84,2475,2476],{},[98,2477,2478],{},"      wcstoul       ()     ",[84,2480,1459],{},[84,2482,2483,661,2485],{},[98,2484,1609],{},[98,2486,1466],{},[69,2488,2489,2494,2496],{},[84,2490,2491],{},[98,2492,2493],{},"      wcstoull       ()     ",[84,2495,1459],{},[84,2497,2498,661,2500],{},[98,2499,1625],{},[98,2501,1466],{},[69,2503,2504,2509,2512],{},[84,2505,2506],{},[98,2507,2508],{},"      wcsxfrm       ()     ",[84,2510,2511],{},"Length of transformed wide string",[84,2513,2514],{},[98,2515,1642],{},[69,2517,2518,2523,2526],{},[84,2519,2520],{},[98,2521,2522],{},"      wctob       ()     ",[84,2524,2525],{},"Converted character",[84,2527,2528],{},[98,2529,391],{},[69,2531,2532,2537,2539],{},[84,2533,2534],{},[98,2535,2536],{},"      wctomb       ()       , s != NULL     ",[84,2538,2207],{},[84,2540,2541],{},[98,2542,899],{},[69,2544,2545,2550,2552],{},[84,2546,2547],{},[98,2548,2549],{},"      wctomb_s       ()       , s != NULL     ",[84,2551,2207],{},[84,2553,2554],{},[98,2555,899],{},[69,2557,2558,2563,2569],{},[84,2559,2560],{},[98,2561,2562],{},"      wctrans       ()     ",[84,2564,2565,2566],{},"Valid argument to ",[98,2567,2568],{},"towctrans",[84,2570,2571],{},[98,2572,1409],{},[69,2574,2575,2580,2585],{},[84,2576,2577],{},[98,2578,2579],{},"      wctype       ()     ",[84,2581,2565,2582],{},[98,2583,2584],{},"iswctype",[84,2586,2587],{},[98,2588,1409],{},[69,2590,2591,2596,2598],{},[84,2592,2593],{},[98,2594,2595],{},"      wmemchr       ()     ",[84,2597,2221],{},[84,2599,2600],{},[98,2601,108],{},[69,2603,2604,2609,2611],{},[84,2605,2606],{},[98,2607,2608],{},"      wprintf_s       ()     ",[84,2610,673],{},[84,2612,483],{},[69,2614,2615,2620,2622],{},[84,2616,2617],{},[98,2618,2619],{},"      wscanf       ()     ",[84,2621,600],{},[84,2623,2624,361],{},[98,2625,391],{},[69,2627,2628,2633,2635],{},[84,2629,2630],{},[98,2631,2632],{},"      wscanf_s       ()     ",[84,2634,600],{},[84,2636,2637,361],{},[98,2638,391],{},[39,2640,2641,2642,392,2646,2649],{},"Note: According to ",[43,2643,2645],{"href":2644},"\u002Fsei-cert-c-coding-standard\u002Fthe-void\u002Fvoid-fio35-c-use-feof-and-ferror-to-detect-end-of-file-and-file-errors-when-sizeofint-sizeofchar","FIO35-C",[43,2647,2648],{"href":2644},". Use feof() and ferror() to detect end-of-file and file errors when sizeof(int) == sizeof(char)"," , callers should verify end-of-file and file errors for the functions in this table as follows:",[39,2651,2652,2654,2655,2658,2659,392,2662,2654,2664],{},[394,2653,396],{}," By calling ",[98,2656,2657],{},"ferror()"," and ",[98,2660,2661],{},"feof()",[394,2663,511],{},[98,2665,2657],{},[39,2667,2668,2669,2672,2673,2675],{},"The ",[98,2670,2671],{},"ungetc()"," function does not set the error indicator even when it fails, so it is not possible to check for errors reliably unless it is known that the argument is not equal to ",[98,2674,391],{}," .",[39,2677,2678,2679,2683],{},"The C Standard 7.31.3.10 paragraph 3 [ ",[43,2680,2682],{"href":2681},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Faa-bibliography#AA.Bibliography-ISO-IEC9899-2024","ISO\u002FIEC 9899:2024"," ] states that",[2685,2686,2687],"blockquote",{},[39,2688,2689],{},")ne wide character of pushback is guaranteed...",[39,2691,2692,2693,392,2697,2700],{},"so this should not be an issue if, at most, one character is ever pushed back before reading again. (See ",[43,2694,2696],{"href":2695},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio13-c","FIO13-C",[43,2698,2699],{"href":2695},". Never push back anything other than one read character"," .)",[2702,2703,2705,2706,1895],"h2",{"id":2704},"noncompliant-code-example-setlocale","Noncompliant Code Example ( ",[98,2707,2708],{},"setlocale()",[39,2710,2711,2712,2715,2716,2718,2719,2722,2723,2725,2726,2729,2730,2733,2734,2675],{},"In this noncompliant code example, the function ",[98,2713,2714],{},"utf8_to_wcs()"," attempts to convert a sequence of UTF-8 characters to wide characters . It first invokes ",[98,2717,2708],{}," to set the global locale to the implementation-defined ",[98,2720,2721],{},"en_US.UTF-8"," but does not check for failure. The ",[98,2724,2708],{}," function will fail by returning a null pointer, for example, when the locale is not installed. The function may fail for other reasons as well, such as the lack of resources.  Depending on the sequence of characters pointed to by ",[98,2727,2728],{},"utf8"," , the subsequent call to ",[98,2731,2732],{},"mbstowcs()"," may fail or result in the function storing an unexpected sequence of wide characters in the supplied buffer ",[98,2735,2736],{},"wcs",[2738,2739,2741],"code-block",{"quality":2740},"bad",[2742,2743,2748],"pre",{"className":2744,"code":2745,"language":2746,"meta":2747,"style":2747},"language-c shiki shiki-themes github-light github-dark monokai","#include \u003Clocale.h>\n#include \u003Cstdlib.h>\n \nint utf8_to_wcs(wchar_t *wcs, size_t n, const char *utf8,\n                size_t *size) {\n  if (NULL == size) {\n    return -1;\n  }\n  setlocale(LC_CTYPE, \"en_US.UTF-8\");\n  *size = mbstowcs(wcs, utf8, n);\n  return 0;\n}\n","c","",[98,2749,2750,2763,2771,2778,2826,2840,2858,2872,2878,2893,2911,2922],{"__ignoreMap":2747},[2751,2752,2755,2759],"span",{"class":2753,"line":2754},"line",1,[2751,2756,2758],{"class":2757},"sC2Qs","#include",[2751,2760,2762],{"class":2761},"sstjo"," \u003Clocale.h>\n",[2751,2764,2766,2768],{"class":2753,"line":2765},2,[2751,2767,2758],{"class":2757},[2751,2769,2770],{"class":2761}," \u003Cstdlib.h>\n",[2751,2772,2774],{"class":2753,"line":2773},3,[2751,2775,2777],{"class":2776},"sMOD_"," \n",[2751,2779,2781,2785,2789,2792,2796,2799,2802,2805,2808,2811,2813,2816,2819,2821,2823],{"class":2753,"line":2780},4,[2751,2782,2784],{"class":2783},"sq6CD","int",[2751,2786,2788],{"class":2787},"srTi1"," utf8_to_wcs",[2751,2790,2791],{"class":2776},"(",[2751,2793,2795],{"class":2794},"s-m8C","wchar_t",[2751,2797,2798],{"class":2757}," *",[2751,2800,2736],{"class":2801},"sTHNf",[2751,2803,2804],{"class":2776},", ",[2751,2806,2807],{"class":2783},"size_t",[2751,2809,2810],{"class":2801}," n",[2751,2812,2804],{"class":2776},[2751,2814,2815],{"class":2757},"const",[2751,2817,2818],{"class":2783}," char",[2751,2820,2798],{"class":2757},[2751,2822,2728],{"class":2801},[2751,2824,2825],{"class":2776},",\n",[2751,2827,2829,2832,2834,2837],{"class":2753,"line":2828},5,[2751,2830,2831],{"class":2783},"                size_t",[2751,2833,2798],{"class":2757},[2751,2835,2836],{"class":2801},"size",[2751,2838,2839],{"class":2776},") {\n",[2751,2841,2843,2846,2849,2852,2855],{"class":2753,"line":2842},6,[2751,2844,2845],{"class":2757},"  if",[2751,2847,2848],{"class":2776}," (",[2751,2850,108],{"class":2851},"s7F3e",[2751,2853,2854],{"class":2757}," ==",[2751,2856,2857],{"class":2776}," size) {\n",[2751,2859,2861,2864,2867,2869],{"class":2753,"line":2860},7,[2751,2862,2863],{"class":2757},"    return",[2751,2865,2866],{"class":2757}," -",[2751,2868,396],{"class":2851},[2751,2870,2871],{"class":2776},";\n",[2751,2873,2875],{"class":2753,"line":2874},8,[2751,2876,2877],{"class":2776},"  }\n",[2751,2879,2881,2884,2887,2890],{"class":2753,"line":2880},9,[2751,2882,2883],{"class":2787},"  setlocale",[2751,2885,2886],{"class":2776},"(LC_CTYPE, ",[2751,2888,2889],{"class":2761},"\"en_US.UTF-8\"",[2751,2891,2892],{"class":2776},");\n",[2751,2894,2896,2899,2902,2905,2908],{"class":2753,"line":2895},10,[2751,2897,2898],{"class":2757},"  *",[2751,2900,2901],{"class":2776},"size ",[2751,2903,2904],{"class":2757},"=",[2751,2906,2907],{"class":2787}," mbstowcs",[2751,2909,2910],{"class":2776},"(wcs, utf8, n);\n",[2751,2912,2914,2917,2920],{"class":2753,"line":2913},11,[2751,2915,2916],{"class":2757},"  return",[2751,2918,2919],{"class":2851}," 0",[2751,2921,2871],{"class":2776},[2751,2923,2925],{"class":2753,"line":2924},12,[2751,2926,2927],{"class":2776},"}\n",[2702,2929,2931,2932,1895],{"id":2930},"compliant-solution-setlocale","Compliant Solution ( ",[98,2933,2708],{},[39,2935,2936,2937,2939,2940,2942],{},"This compliant solution checks the value returned by ",[98,2938,2708],{}," and avoids calling ",[98,2941,2732],{}," if the function fails. The function also takes care to restore the locale to its initial setting before returning control to the caller.",[2738,2944,2946],{"quality":2945},"good",[2742,2947,2949],{"className":2744,"code":2948,"language":2746,"meta":2747,"style":2747},"#include \u003Clocale.h>\n#include \u003Cstdlib.h>\n \nint utf8_to_wcs(wchar_t *wcs, size_t n, const char *utf8,\n                size_t *size) {\n  if (NULL == size) {\n    return -1;\n  }\n  const char *save = setlocale(LC_CTYPE, \"en_US.UTF-8\");\n  if (NULL == save) {\n    return -1;\n  }\n\n  *size = mbstowcs(wcs, utf8, n);\n  if (NULL == setlocale(LC_CTYPE, save)) {\n    return -1;\n  }\n  return 0;\n}\n",[98,2950,2951,2957,2963,2967,2999,3009,3021,3031,3035,3058,3071,3081,3085,3091,3104,3120,3131,3136,3145],{"__ignoreMap":2747},[2751,2952,2953,2955],{"class":2753,"line":2754},[2751,2954,2758],{"class":2757},[2751,2956,2762],{"class":2761},[2751,2958,2959,2961],{"class":2753,"line":2765},[2751,2960,2758],{"class":2757},[2751,2962,2770],{"class":2761},[2751,2964,2965],{"class":2753,"line":2773},[2751,2966,2777],{"class":2776},[2751,2968,2969,2971,2973,2975,2977,2979,2981,2983,2985,2987,2989,2991,2993,2995,2997],{"class":2753,"line":2780},[2751,2970,2784],{"class":2783},[2751,2972,2788],{"class":2787},[2751,2974,2791],{"class":2776},[2751,2976,2795],{"class":2794},[2751,2978,2798],{"class":2757},[2751,2980,2736],{"class":2801},[2751,2982,2804],{"class":2776},[2751,2984,2807],{"class":2783},[2751,2986,2810],{"class":2801},[2751,2988,2804],{"class":2776},[2751,2990,2815],{"class":2757},[2751,2992,2818],{"class":2783},[2751,2994,2798],{"class":2757},[2751,2996,2728],{"class":2801},[2751,2998,2825],{"class":2776},[2751,3000,3001,3003,3005,3007],{"class":2753,"line":2828},[2751,3002,2831],{"class":2783},[2751,3004,2798],{"class":2757},[2751,3006,2836],{"class":2801},[2751,3008,2839],{"class":2776},[2751,3010,3011,3013,3015,3017,3019],{"class":2753,"line":2842},[2751,3012,2845],{"class":2757},[2751,3014,2848],{"class":2776},[2751,3016,108],{"class":2851},[2751,3018,2854],{"class":2757},[2751,3020,2857],{"class":2776},[2751,3022,3023,3025,3027,3029],{"class":2753,"line":2860},[2751,3024,2863],{"class":2757},[2751,3026,2866],{"class":2757},[2751,3028,396],{"class":2851},[2751,3030,2871],{"class":2776},[2751,3032,3033],{"class":2753,"line":2874},[2751,3034,2877],{"class":2776},[2751,3036,3037,3040,3042,3044,3047,3049,3052,3054,3056],{"class":2753,"line":2880},[2751,3038,3039],{"class":2757},"  const",[2751,3041,2818],{"class":2783},[2751,3043,2798],{"class":2757},[2751,3045,3046],{"class":2776},"save ",[2751,3048,2904],{"class":2757},[2751,3050,3051],{"class":2787}," setlocale",[2751,3053,2886],{"class":2776},[2751,3055,2889],{"class":2761},[2751,3057,2892],{"class":2776},[2751,3059,3060,3062,3064,3066,3068],{"class":2753,"line":2895},[2751,3061,2845],{"class":2757},[2751,3063,2848],{"class":2776},[2751,3065,108],{"class":2851},[2751,3067,2854],{"class":2757},[2751,3069,3070],{"class":2776}," save) {\n",[2751,3072,3073,3075,3077,3079],{"class":2753,"line":2913},[2751,3074,2863],{"class":2757},[2751,3076,2866],{"class":2757},[2751,3078,396],{"class":2851},[2751,3080,2871],{"class":2776},[2751,3082,3083],{"class":2753,"line":2924},[2751,3084,2877],{"class":2776},[2751,3086,3088],{"class":2753,"line":3087},13,[2751,3089,3090],{"emptyLinePlaceholder":7},"\n",[2751,3092,3094,3096,3098,3100,3102],{"class":2753,"line":3093},14,[2751,3095,2898],{"class":2757},[2751,3097,2901],{"class":2776},[2751,3099,2904],{"class":2757},[2751,3101,2907],{"class":2787},[2751,3103,2910],{"class":2776},[2751,3105,3107,3109,3111,3113,3115,3117],{"class":2753,"line":3106},15,[2751,3108,2845],{"class":2757},[2751,3110,2848],{"class":2776},[2751,3112,108],{"class":2851},[2751,3114,2854],{"class":2757},[2751,3116,3051],{"class":2787},[2751,3118,3119],{"class":2776},"(LC_CTYPE, save)) {\n",[2751,3121,3123,3125,3127,3129],{"class":2753,"line":3122},16,[2751,3124,2863],{"class":2757},[2751,3126,2866],{"class":2757},[2751,3128,396],{"class":2851},[2751,3130,2871],{"class":2776},[2751,3132,3134],{"class":2753,"line":3133},17,[2751,3135,2877],{"class":2776},[2751,3137,3139,3141,3143],{"class":2753,"line":3138},18,[2751,3140,2916],{"class":2757},[2751,3142,2919],{"class":2851},[2751,3144,2871],{"class":2776},[2751,3146,3148],{"class":2753,"line":3147},19,[2751,3149,2927],{"class":2776},[2702,3151,2705,3153,1895],{"id":3152},"noncompliant-code-example-calloc",[98,3154,3155],{},"calloc()",[39,3157,3158,3159,661,3162,3165,3166,3169,3170,3174,3175,3177,3178,2675],{},"In this noncompliant code example, ",[98,3160,3161],{},"temp_num",[98,3163,3164],{},"tmp2"," , and ",[98,3167,3168],{},"num_of_records"," are derived from a ",[43,3171,3173],{"href":3172},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fbb-definitions#BB.Definitions-taintedsource","tainted source"," . Consequently, an attacker can easily cause ",[98,3176,3155],{}," to fail by providing a large value for ",[98,3179,3168],{},[2738,3181,3182],{"quality":2740},[2742,3183,3185],{"className":2744,"code":3184,"language":2746,"meta":2747,"style":2747},"#include \u003Cstdlib.h>\n#include \u003Cstring.h>\n \nenum { SIG_DESC_SIZE = 32 };\n\ntypedef struct {\n  char sig_desc[SIG_DESC_SIZE];\n} signal_info;\n \nvoid func(size_t num_of_records, size_t temp_num,\n          const char *tmp2, size_t tmp2_size_bytes) {\n  signal_info *start = (signal_info *)calloc(num_of_records,\n                                          sizeof(signal_info));\n\n  if (tmp2 == NULL) {\n    \u002F* Handle error *\u002F\n  } else if (temp_num > num_of_records || temp_num == 0) {\n    \u002F* Handle error *\u002F\n  } else if (tmp2_size_bytes \u003C SIG_DESC_SIZE) {\n    \u002F* Handle error *\u002F\n  }\n\n  signal_info *point = start + temp_num - 1;\n  memcpy(point->sig_desc, tmp2, SIG_DESC_SIZE);\n  point->sig_desc[SIG_DESC_SIZE - 1] = '\\0';\n  \u002F* ... *\u002F\n  free(start);\n}\n",[98,3186,3187,3193,3200,3204,3220,3224,3235,3247,3252,3256,3280,3300,3327,3335,3339,3354,3360,3392,3396,3413,3418,3423,3428,3456,3465,3491,3497,3506],{"__ignoreMap":2747},[2751,3188,3189,3191],{"class":2753,"line":2754},[2751,3190,2758],{"class":2757},[2751,3192,2770],{"class":2761},[2751,3194,3195,3197],{"class":2753,"line":2765},[2751,3196,2758],{"class":2757},[2751,3198,3199],{"class":2761}," \u003Cstring.h>\n",[2751,3201,3202],{"class":2753,"line":2773},[2751,3203,2777],{"class":2776},[2751,3205,3206,3209,3212,3214,3217],{"class":2753,"line":2780},[2751,3207,3208],{"class":2783},"enum",[2751,3210,3211],{"class":2776}," { SIG_DESC_SIZE ",[2751,3213,2904],{"class":2757},[2751,3215,3216],{"class":2851}," 32",[2751,3218,3219],{"class":2776}," };\n",[2751,3221,3222],{"class":2753,"line":2828},[2751,3223,3090],{"emptyLinePlaceholder":7},[2751,3225,3226,3229,3232],{"class":2753,"line":2842},[2751,3227,3228],{"class":2757},"typedef",[2751,3230,3231],{"class":2783}," struct",[2751,3233,3234],{"class":2776}," {\n",[2751,3236,3237,3240,3244],{"class":2753,"line":2860},[2751,3238,3239],{"class":2783},"  char",[2751,3241,3243],{"class":3242},"sOrwc"," sig_desc",[2751,3245,3246],{"class":2776},"[SIG_DESC_SIZE];\n",[2751,3248,3249],{"class":2753,"line":2874},[2751,3250,3251],{"class":2776},"} signal_info;\n",[2751,3253,3254],{"class":2753,"line":2880},[2751,3255,2777],{"class":2776},[2751,3257,3258,3261,3264,3266,3268,3271,3273,3275,3278],{"class":2753,"line":2895},[2751,3259,3260],{"class":2783},"void",[2751,3262,3263],{"class":2787}," func",[2751,3265,2791],{"class":2776},[2751,3267,2807],{"class":2783},[2751,3269,3270],{"class":2801}," num_of_records",[2751,3272,2804],{"class":2776},[2751,3274,2807],{"class":2783},[2751,3276,3277],{"class":2801}," temp_num",[2751,3279,2825],{"class":2776},[2751,3281,3282,3285,3287,3289,3291,3293,3295,3298],{"class":2753,"line":2913},[2751,3283,3284],{"class":2757},"          const",[2751,3286,2818],{"class":2783},[2751,3288,2798],{"class":2757},[2751,3290,3164],{"class":2801},[2751,3292,2804],{"class":2776},[2751,3294,2807],{"class":2783},[2751,3296,3297],{"class":2801}," tmp2_size_bytes",[2751,3299,2839],{"class":2776},[2751,3301,3302,3305,3308,3311,3313,3316,3318,3321,3324],{"class":2753,"line":2924},[2751,3303,3304],{"class":2776},"  signal_info ",[2751,3306,3307],{"class":2757},"*",[2751,3309,3310],{"class":2776},"start ",[2751,3312,2904],{"class":2757},[2751,3314,3315],{"class":2776}," (signal_info ",[2751,3317,3307],{"class":2757},[2751,3319,3320],{"class":2776},")",[2751,3322,3323],{"class":2787},"calloc",[2751,3325,3326],{"class":2776},"(num_of_records,\n",[2751,3328,3329,3332],{"class":2753,"line":3087},[2751,3330,3331],{"class":2757},"                                          sizeof",[2751,3333,3334],{"class":2776},"(signal_info));\n",[2751,3336,3337],{"class":2753,"line":3093},[2751,3338,3090],{"emptyLinePlaceholder":7},[2751,3340,3341,3343,3346,3349,3352],{"class":2753,"line":3106},[2751,3342,2845],{"class":2757},[2751,3344,3345],{"class":2776}," (tmp2 ",[2751,3347,3348],{"class":2757},"==",[2751,3350,3351],{"class":2851}," NULL",[2751,3353,2839],{"class":2776},[2751,3355,3356],{"class":2753,"line":3122},[2751,3357,3359],{"class":3358},"s8-w5","    \u002F* Handle error *\u002F\n",[2751,3361,3362,3365,3368,3371,3374,3377,3380,3383,3386,3388,3390],{"class":2753,"line":3133},[2751,3363,3364],{"class":2776},"  } ",[2751,3366,3367],{"class":2757},"else",[2751,3369,3370],{"class":2757}," if",[2751,3372,3373],{"class":2776}," (temp_num ",[2751,3375,3376],{"class":2757},">",[2751,3378,3379],{"class":2776}," num_of_records ",[2751,3381,3382],{"class":2757},"||",[2751,3384,3385],{"class":2776}," temp_num ",[2751,3387,3348],{"class":2757},[2751,3389,2919],{"class":2851},[2751,3391,2839],{"class":2776},[2751,3393,3394],{"class":2753,"line":3138},[2751,3395,3359],{"class":3358},[2751,3397,3398,3400,3402,3404,3407,3410],{"class":2753,"line":3147},[2751,3399,3364],{"class":2776},[2751,3401,3367],{"class":2757},[2751,3403,3370],{"class":2757},[2751,3405,3406],{"class":2776}," (tmp2_size_bytes ",[2751,3408,3409],{"class":2757},"\u003C",[2751,3411,3412],{"class":2776}," SIG_DESC_SIZE) {\n",[2751,3414,3416],{"class":2753,"line":3415},20,[2751,3417,3359],{"class":3358},[2751,3419,3421],{"class":2753,"line":3420},21,[2751,3422,2877],{"class":2776},[2751,3424,3426],{"class":2753,"line":3425},22,[2751,3427,3090],{"emptyLinePlaceholder":7},[2751,3429,3431,3433,3435,3438,3440,3443,3446,3448,3451,3454],{"class":2753,"line":3430},23,[2751,3432,3304],{"class":2776},[2751,3434,3307],{"class":2757},[2751,3436,3437],{"class":2776},"point ",[2751,3439,2904],{"class":2757},[2751,3441,3442],{"class":2776}," start ",[2751,3444,3445],{"class":2757},"+",[2751,3447,3385],{"class":2776},[2751,3449,3450],{"class":2757},"-",[2751,3452,3453],{"class":2851}," 1",[2751,3455,2871],{"class":2776},[2751,3457,3459,3462],{"class":2753,"line":3458},24,[2751,3460,3461],{"class":2787},"  memcpy",[2751,3463,3464],{"class":2776},"(point->sig_desc, tmp2, SIG_DESC_SIZE);\n",[2751,3466,3468,3471,3473,3475,3478,3480,3483,3486,3489],{"class":2753,"line":3467},25,[2751,3469,3470],{"class":2776},"  point->sig_desc[SIG_DESC_SIZE ",[2751,3472,3450],{"class":2757},[2751,3474,3453],{"class":2851},[2751,3476,3477],{"class":2776},"] ",[2751,3479,2904],{"class":2757},[2751,3481,3482],{"class":2761}," '",[2751,3484,3485],{"class":2851},"\\0",[2751,3487,3488],{"class":2761},"'",[2751,3490,2871],{"class":2776},[2751,3492,3494],{"class":2753,"line":3493},26,[2751,3495,3496],{"class":3358},"  \u002F* ... *\u002F\n",[2751,3498,3500,3503],{"class":2753,"line":3499},27,[2751,3501,3502],{"class":2787},"  free",[2751,3504,3505],{"class":2776},"(start);\n",[2751,3507,3509],{"class":2753,"line":3508},28,[2751,3510,2927],{"class":2776},[39,3512,3513,3514,3516,3517,3520,3521,3523,3524,3526,3527,3530,3531,3533,3534,2675],{},"When ",[98,3515,3155],{}," fails, it returns a null pointer that is assigned to ",[98,3518,3519],{},"start"," . If ",[98,3522,3519],{}," is null, an attacker can provide a value for ",[98,3525,3161],{}," that, when scaled by ",[98,3528,3529],{},"sizeof(signal_info)"," , references a writable address to which control is eventually transferred. The contents of the string referenced by ",[98,3532,3164],{}," can then be used to overwrite the address, resulting in an arbitrary code execution ",[43,3535,3537],{"href":3536},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fbb-definitions#BB.Definitions-vulnerability","vulnerability",[2702,3539,2931,3541,1895],{"id":3540},"compliant-solution-calloc",[98,3542,3155],{},[39,3544,3545,3546,3548],{},"To correct this error, ensure the pointer returned by ",[98,3547,3155],{}," is not null:",[2738,3550,3551],{"quality":2945},[2742,3552,3554],{"className":2744,"code":3553,"language":2746,"meta":2747,"style":2747},"#include \u003Cstdlib.h>\n#include \u003Cstring.h>\n\nenum { SIG_DESC_SIZE = 32 };\n\ntypedef struct {\n  char sig_desc[SIG_DESC_SIZE];\n} signal_info;\n \nvoid func(size_t num_of_records, size_t temp_num,\n          const char *tmp2, size_t tmp2_size_bytes) {\n  signal_info *start = (signal_info *)calloc(num_of_records,\n                                           sizeof(signal_info));\n  if (start == NULL) {\n    \u002F* Handle allocation error *\u002F\n  } else if (tmp2 == NULL) {\n    \u002F* Handle error *\u002F\n  } else if (temp_num > num_of_records || temp_num == 0) {\n    \u002F* Handle error *\u002F\n  } else if (tmp2_size_bytes \u003C SIG_DESC_SIZE) {\n    \u002F* Handle error *\u002F\n  }\n\n  signal_info *point = start + temp_num - 1; \n  memcpy(point->sig_desc, tmp2, SIG_DESC_SIZE);\n  point->sig_desc[SIG_DESC_SIZE - 1] = '\\0';\n  \u002F* ... *\u002F\n  free(start);\n}\n",[98,3555,3556,3562,3568,3572,3584,3588,3596,3604,3608,3613,3633,3651,3671,3678,3691,3696,3712,3716,3740,3744,3758,3762,3766,3770,3793,3799,3819,3823,3829],{"__ignoreMap":2747},[2751,3557,3558,3560],{"class":2753,"line":2754},[2751,3559,2758],{"class":2757},[2751,3561,2770],{"class":2761},[2751,3563,3564,3566],{"class":2753,"line":2765},[2751,3565,2758],{"class":2757},[2751,3567,3199],{"class":2761},[2751,3569,3570],{"class":2753,"line":2773},[2751,3571,3090],{"emptyLinePlaceholder":7},[2751,3573,3574,3576,3578,3580,3582],{"class":2753,"line":2780},[2751,3575,3208],{"class":2783},[2751,3577,3211],{"class":2776},[2751,3579,2904],{"class":2757},[2751,3581,3216],{"class":2851},[2751,3583,3219],{"class":2776},[2751,3585,3586],{"class":2753,"line":2828},[2751,3587,3090],{"emptyLinePlaceholder":7},[2751,3589,3590,3592,3594],{"class":2753,"line":2842},[2751,3591,3228],{"class":2757},[2751,3593,3231],{"class":2783},[2751,3595,3234],{"class":2776},[2751,3597,3598,3600,3602],{"class":2753,"line":2860},[2751,3599,3239],{"class":2783},[2751,3601,3243],{"class":3242},[2751,3603,3246],{"class":2776},[2751,3605,3606],{"class":2753,"line":2874},[2751,3607,3251],{"class":2776},[2751,3609,3610],{"class":2753,"line":2880},[2751,3611,3612],{"class":2776}," \n",[2751,3614,3615,3617,3619,3621,3623,3625,3627,3629,3631],{"class":2753,"line":2895},[2751,3616,3260],{"class":2783},[2751,3618,3263],{"class":2787},[2751,3620,2791],{"class":2776},[2751,3622,2807],{"class":2783},[2751,3624,3270],{"class":2801},[2751,3626,2804],{"class":2776},[2751,3628,2807],{"class":2783},[2751,3630,3277],{"class":2801},[2751,3632,2825],{"class":2776},[2751,3634,3635,3637,3639,3641,3643,3645,3647,3649],{"class":2753,"line":2913},[2751,3636,3284],{"class":2757},[2751,3638,2818],{"class":2783},[2751,3640,2798],{"class":2757},[2751,3642,3164],{"class":2801},[2751,3644,2804],{"class":2776},[2751,3646,2807],{"class":2783},[2751,3648,3297],{"class":2801},[2751,3650,2839],{"class":2776},[2751,3652,3653,3655,3657,3659,3661,3663,3665,3667,3669],{"class":2753,"line":2924},[2751,3654,3304],{"class":2776},[2751,3656,3307],{"class":2757},[2751,3658,3310],{"class":2776},[2751,3660,2904],{"class":2757},[2751,3662,3315],{"class":2776},[2751,3664,3307],{"class":2757},[2751,3666,3320],{"class":2776},[2751,3668,3323],{"class":2787},[2751,3670,3326],{"class":2776},[2751,3672,3673,3676],{"class":2753,"line":3087},[2751,3674,3675],{"class":2757},"                                           sizeof",[2751,3677,3334],{"class":2776},[2751,3679,3680,3682,3685,3687,3689],{"class":2753,"line":3093},[2751,3681,2845],{"class":2757},[2751,3683,3684],{"class":2776}," (start ",[2751,3686,3348],{"class":2757},[2751,3688,3351],{"class":2851},[2751,3690,2839],{"class":2776},[2751,3692,3693],{"class":2753,"line":3106},[2751,3694,3695],{"class":3358},"    \u002F* Handle allocation error *\u002F\n",[2751,3697,3698,3700,3702,3704,3706,3708,3710],{"class":2753,"line":3122},[2751,3699,3364],{"class":2776},[2751,3701,3367],{"class":2757},[2751,3703,3370],{"class":2757},[2751,3705,3345],{"class":2776},[2751,3707,3348],{"class":2757},[2751,3709,3351],{"class":2851},[2751,3711,2839],{"class":2776},[2751,3713,3714],{"class":2753,"line":3133},[2751,3715,3359],{"class":3358},[2751,3717,3718,3720,3722,3724,3726,3728,3730,3732,3734,3736,3738],{"class":2753,"line":3138},[2751,3719,3364],{"class":2776},[2751,3721,3367],{"class":2757},[2751,3723,3370],{"class":2757},[2751,3725,3373],{"class":2776},[2751,3727,3376],{"class":2757},[2751,3729,3379],{"class":2776},[2751,3731,3382],{"class":2757},[2751,3733,3385],{"class":2776},[2751,3735,3348],{"class":2757},[2751,3737,2919],{"class":2851},[2751,3739,2839],{"class":2776},[2751,3741,3742],{"class":2753,"line":3147},[2751,3743,3359],{"class":3358},[2751,3745,3746,3748,3750,3752,3754,3756],{"class":2753,"line":3415},[2751,3747,3364],{"class":2776},[2751,3749,3367],{"class":2757},[2751,3751,3370],{"class":2757},[2751,3753,3406],{"class":2776},[2751,3755,3409],{"class":2757},[2751,3757,3412],{"class":2776},[2751,3759,3760],{"class":2753,"line":3420},[2751,3761,3359],{"class":3358},[2751,3763,3764],{"class":2753,"line":3425},[2751,3765,2877],{"class":2776},[2751,3767,3768],{"class":2753,"line":3430},[2751,3769,3090],{"emptyLinePlaceholder":7},[2751,3771,3772,3774,3776,3778,3780,3782,3784,3786,3788,3790],{"class":2753,"line":3458},[2751,3773,3304],{"class":2776},[2751,3775,3307],{"class":2757},[2751,3777,3437],{"class":2776},[2751,3779,2904],{"class":2757},[2751,3781,3442],{"class":2776},[2751,3783,3445],{"class":2757},[2751,3785,3385],{"class":2776},[2751,3787,3450],{"class":2757},[2751,3789,3453],{"class":2851},[2751,3791,3792],{"class":2776},"; \n",[2751,3794,3795,3797],{"class":2753,"line":3467},[2751,3796,3461],{"class":2787},[2751,3798,3464],{"class":2776},[2751,3800,3801,3803,3805,3807,3809,3811,3813,3815,3817],{"class":2753,"line":3493},[2751,3802,3470],{"class":2776},[2751,3804,3450],{"class":2757},[2751,3806,3453],{"class":2851},[2751,3808,3477],{"class":2776},[2751,3810,2904],{"class":2757},[2751,3812,3482],{"class":2761},[2751,3814,3485],{"class":2851},[2751,3816,3488],{"class":2761},[2751,3818,2871],{"class":2776},[2751,3820,3821],{"class":2753,"line":3499},[2751,3822,3496],{"class":3358},[2751,3824,3825,3827],{"class":2753,"line":3508},[2751,3826,3502],{"class":2787},[2751,3828,3505],{"class":2776},[2751,3830,3832],{"class":2753,"line":3831},29,[2751,3833,2927],{"class":2776},[2702,3835,2705,3837,1895],{"id":3836},"noncompliant-code-example-realloc",[98,3838,3839],{},"realloc()",[39,3841,3842,3843,3845,3846,3848,3849,3851,3852,3854],{},"This noncompliant code example calls ",[98,3844,3839],{}," to resize the memory referred to by ",[98,3847,39],{}," . However, if ",[98,3850,3839],{}," fails, it returns a null pointer and the connection between the original block of memory and ",[98,3853,39],{}," is lost, resulting in a memory leak.",[2738,3856,3857],{"quality":2740},[2742,3858,3860],{"className":2744,"code":3859,"language":2746,"meta":2747,"style":2747},"#include \u003Cstdlib.h>\n \nvoid *p;\nvoid func(size_t new_size) {\n  if (new_size == 0) {\n    \u002F* Handle error *\u002F\n  }\n  p = realloc(p, new_size);\n  if (p == NULL) {\n   \u002F* Handle error *\u002F\n  }\n}\n",[98,3861,3862,3868,3872,3881,3896,3909,3913,3917,3930,3943,3948,3952],{"__ignoreMap":2747},[2751,3863,3864,3866],{"class":2753,"line":2754},[2751,3865,2758],{"class":2757},[2751,3867,2770],{"class":2761},[2751,3869,3870],{"class":2753,"line":2765},[2751,3871,2777],{"class":2776},[2751,3873,3874,3876,3878],{"class":2753,"line":2773},[2751,3875,3260],{"class":2783},[2751,3877,2798],{"class":2757},[2751,3879,3880],{"class":2776},"p;\n",[2751,3882,3883,3885,3887,3889,3891,3894],{"class":2753,"line":2780},[2751,3884,3260],{"class":2783},[2751,3886,3263],{"class":2787},[2751,3888,2791],{"class":2776},[2751,3890,2807],{"class":2783},[2751,3892,3893],{"class":2801}," new_size",[2751,3895,2839],{"class":2776},[2751,3897,3898,3900,3903,3905,3907],{"class":2753,"line":2828},[2751,3899,2845],{"class":2757},[2751,3901,3902],{"class":2776}," (new_size ",[2751,3904,3348],{"class":2757},[2751,3906,2919],{"class":2851},[2751,3908,2839],{"class":2776},[2751,3910,3911],{"class":2753,"line":2842},[2751,3912,3359],{"class":3358},[2751,3914,3915],{"class":2753,"line":2860},[2751,3916,2877],{"class":2776},[2751,3918,3919,3922,3924,3927],{"class":2753,"line":2874},[2751,3920,3921],{"class":2776},"  p ",[2751,3923,2904],{"class":2757},[2751,3925,3926],{"class":2787}," realloc",[2751,3928,3929],{"class":2776},"(p, new_size);\n",[2751,3931,3932,3934,3937,3939,3941],{"class":2753,"line":2880},[2751,3933,2845],{"class":2757},[2751,3935,3936],{"class":2776}," (p ",[2751,3938,3348],{"class":2757},[2751,3940,3351],{"class":2851},[2751,3942,2839],{"class":2776},[2751,3944,3945],{"class":2753,"line":2895},[2751,3946,3947],{"class":3358},"   \u002F* Handle error *\u002F\n",[2751,3949,3950],{"class":2753,"line":2913},[2751,3951,2877],{"class":2776},[2751,3953,3954],{"class":2753,"line":2924},[2751,3955,2927],{"class":2776},[39,3957,3958,3959,392,3963,2675],{},"This code example complies with ",[43,3960,3962],{"href":3961},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmemory-management-mem\u002Fmem04-c","MEM04-C",[43,3964,3965],{"href":3961},". Do not perform zero-length allocations",[2702,3967,2931,3969,1895],{"id":3968},"compliant-solution-realloc",[98,3970,3839],{},[39,3972,3973,3974,3976,3977,3980,3981,3983],{},"In this compliant solution, the result of ",[98,3975,3839],{}," is assigned to the temporary pointer ",[98,3978,3979],{},"q"," and validated before it is assigned to the original pointer ",[98,3982,39],{}," :",[2738,3985,3986],{"quality":2945},[2742,3987,3989],{"className":2744,"code":3988,"language":2746,"meta":2747,"style":2747},"#include \u003Cstdlib.h>\n \nvoid *p;\nvoid func(size_t new_size) {\n  void *q;\n\n  if (new_size == 0) {\n    \u002F* Handle error *\u002F\n  }\n \n  q = realloc(p, new_size);\n  if (q == NULL) {\n   \u002F* Handle error *\u002F\n  } else {\n    p = q;\n  }\n}\n",[98,3990,3991,3997,4001,4009,4023,4033,4037,4049,4053,4057,4061,4072,4085,4089,4097,4107,4111],{"__ignoreMap":2747},[2751,3992,3993,3995],{"class":2753,"line":2754},[2751,3994,2758],{"class":2757},[2751,3996,2770],{"class":2761},[2751,3998,3999],{"class":2753,"line":2765},[2751,4000,2777],{"class":2776},[2751,4002,4003,4005,4007],{"class":2753,"line":2773},[2751,4004,3260],{"class":2783},[2751,4006,2798],{"class":2757},[2751,4008,3880],{"class":2776},[2751,4010,4011,4013,4015,4017,4019,4021],{"class":2753,"line":2780},[2751,4012,3260],{"class":2783},[2751,4014,3263],{"class":2787},[2751,4016,2791],{"class":2776},[2751,4018,2807],{"class":2783},[2751,4020,3893],{"class":2801},[2751,4022,2839],{"class":2776},[2751,4024,4025,4028,4030],{"class":2753,"line":2828},[2751,4026,4027],{"class":2783},"  void",[2751,4029,2798],{"class":2757},[2751,4031,4032],{"class":2776},"q;\n",[2751,4034,4035],{"class":2753,"line":2842},[2751,4036,3090],{"emptyLinePlaceholder":7},[2751,4038,4039,4041,4043,4045,4047],{"class":2753,"line":2860},[2751,4040,2845],{"class":2757},[2751,4042,3902],{"class":2776},[2751,4044,3348],{"class":2757},[2751,4046,2919],{"class":2851},[2751,4048,2839],{"class":2776},[2751,4050,4051],{"class":2753,"line":2874},[2751,4052,3359],{"class":3358},[2751,4054,4055],{"class":2753,"line":2880},[2751,4056,2877],{"class":2776},[2751,4058,4059],{"class":2753,"line":2895},[2751,4060,2777],{"class":2776},[2751,4062,4063,4066,4068,4070],{"class":2753,"line":2913},[2751,4064,4065],{"class":2776},"  q ",[2751,4067,2904],{"class":2757},[2751,4069,3926],{"class":2787},[2751,4071,3929],{"class":2776},[2751,4073,4074,4076,4079,4081,4083],{"class":2753,"line":2924},[2751,4075,2845],{"class":2757},[2751,4077,4078],{"class":2776}," (q ",[2751,4080,3348],{"class":2757},[2751,4082,3351],{"class":2851},[2751,4084,2839],{"class":2776},[2751,4086,4087],{"class":2753,"line":3087},[2751,4088,3947],{"class":3358},[2751,4090,4091,4093,4095],{"class":2753,"line":3093},[2751,4092,3364],{"class":2776},[2751,4094,3367],{"class":2757},[2751,4096,3234],{"class":2776},[2751,4098,4099,4102,4104],{"class":2753,"line":3106},[2751,4100,4101],{"class":2776},"    p ",[2751,4103,2904],{"class":2757},[2751,4105,4106],{"class":2776}," q;\n",[2751,4108,4109],{"class":2753,"line":3122},[2751,4110,2877],{"class":2776},[2751,4112,4113],{"class":2753,"line":3133},[2751,4114,2927],{"class":2776},[2702,4116,2705,4118,1895],{"id":4117},"noncompliant-code-example-fseek",[98,4119,4120],{},"fseek()",[39,4122,4123,4124,4126,4127,4130,4131,4134],{},"In this noncompliant code example, the ",[98,4125,4120],{}," function is used to set the file position to a location ",[98,4128,4129],{},"offset"," in the file referred to by ",[98,4132,4133],{},"file"," prior to reading a sequence of bytes from the file. However, if an I\u002FO error occurs during the seek operation, the subsequent read will fill the buffer with the wrong contents.",[2738,4136,4137],{"quality":2740},[2742,4138,4140],{"className":2744,"code":4139,"language":2746,"meta":2747,"style":2747},"#include \u003Cstdio.h>\n \nsize_t read_at(FILE *file, long offset,\n               void *buf, size_t nbytes) {\n  fseek(file, offset, SEEK_SET);\n  return fread(buf, 1, nbytes, file);\n}\n",[98,4141,4142,4149,4153,4177,4196,4204,4219],{"__ignoreMap":2747},[2751,4143,4144,4146],{"class":2753,"line":2754},[2751,4145,2758],{"class":2757},[2751,4147,4148],{"class":2761}," \u003Cstdio.h>\n",[2751,4150,4151],{"class":2753,"line":2765},[2751,4152,2777],{"class":2776},[2751,4154,4155,4157,4160,4163,4165,4167,4169,4172,4175],{"class":2753,"line":2773},[2751,4156,2807],{"class":2783},[2751,4158,4159],{"class":2787}," read_at",[2751,4161,4162],{"class":2776},"(FILE ",[2751,4164,3307],{"class":2757},[2751,4166,4133],{"class":2801},[2751,4168,2804],{"class":2776},[2751,4170,4171],{"class":2783},"long",[2751,4173,4174],{"class":2801}," offset",[2751,4176,2825],{"class":2776},[2751,4178,4179,4182,4184,4187,4189,4191,4194],{"class":2753,"line":2780},[2751,4180,4181],{"class":2783},"               void",[2751,4183,2798],{"class":2757},[2751,4185,4186],{"class":2801},"buf",[2751,4188,2804],{"class":2776},[2751,4190,2807],{"class":2783},[2751,4192,4193],{"class":2801}," nbytes",[2751,4195,2839],{"class":2776},[2751,4197,4198,4201],{"class":2753,"line":2828},[2751,4199,4200],{"class":2787},"  fseek",[2751,4202,4203],{"class":2776},"(file, offset, SEEK_SET);\n",[2751,4205,4206,4208,4211,4214,4216],{"class":2753,"line":2842},[2751,4207,2916],{"class":2757},[2751,4209,4210],{"class":2787}," fread",[2751,4212,4213],{"class":2776},"(buf, ",[2751,4215,396],{"class":2851},[2751,4217,4218],{"class":2776},", nbytes, file);\n",[2751,4220,4221],{"class":2753,"line":2860},[2751,4222,2927],{"class":2776},[2702,4224,2931,4226,1895],{"id":4225},"compliant-solution-fseek",[98,4227,4120],{},[39,4229,4230,4231,4233,4234,4236],{},"According to the C Standard, the ",[98,4232,4120],{}," function returns a nonzero value to indicate that an error occurred. This compliant solution tests for this condition before reading from a file to eliminate the chance of operating on the wrong portion of the file if ",[98,4235,4120],{}," fails:",[2738,4238,4239],{"quality":2945},[2742,4240,4242],{"className":2744,"code":4241,"language":2746,"meta":2747,"style":2747},"#include \u003Cstdio.h>\n \nsize_t read_at(FILE *file, long offset,\n               void *buf, size_t nbytes) {\n  if (fseek(file, offset, SEEK_SET) != 0) {\n    \u002F* Indicate error to caller *\u002F\n    return 0;\n  }\n  return fread(buf, 1, nbytes, file);\n}\n",[98,4243,4244,4250,4254,4274,4290,4309,4314,4322,4326,4338],{"__ignoreMap":2747},[2751,4245,4246,4248],{"class":2753,"line":2754},[2751,4247,2758],{"class":2757},[2751,4249,4148],{"class":2761},[2751,4251,4252],{"class":2753,"line":2765},[2751,4253,2777],{"class":2776},[2751,4255,4256,4258,4260,4262,4264,4266,4268,4270,4272],{"class":2753,"line":2773},[2751,4257,2807],{"class":2783},[2751,4259,4159],{"class":2787},[2751,4261,4162],{"class":2776},[2751,4263,3307],{"class":2757},[2751,4265,4133],{"class":2801},[2751,4267,2804],{"class":2776},[2751,4269,4171],{"class":2783},[2751,4271,4174],{"class":2801},[2751,4273,2825],{"class":2776},[2751,4275,4276,4278,4280,4282,4284,4286,4288],{"class":2753,"line":2780},[2751,4277,4181],{"class":2783},[2751,4279,2798],{"class":2757},[2751,4281,4186],{"class":2801},[2751,4283,2804],{"class":2776},[2751,4285,2807],{"class":2783},[2751,4287,4193],{"class":2801},[2751,4289,2839],{"class":2776},[2751,4291,4292,4294,4296,4299,4302,4305,4307],{"class":2753,"line":2828},[2751,4293,2845],{"class":2757},[2751,4295,2848],{"class":2776},[2751,4297,4298],{"class":2787},"fseek",[2751,4300,4301],{"class":2776},"(file, offset, SEEK_SET) ",[2751,4303,4304],{"class":2757},"!=",[2751,4306,2919],{"class":2851},[2751,4308,2839],{"class":2776},[2751,4310,4311],{"class":2753,"line":2842},[2751,4312,4313],{"class":3358},"    \u002F* Indicate error to caller *\u002F\n",[2751,4315,4316,4318,4320],{"class":2753,"line":2860},[2751,4317,2863],{"class":2757},[2751,4319,2919],{"class":2851},[2751,4321,2871],{"class":2776},[2751,4323,4324],{"class":2753,"line":2874},[2751,4325,2877],{"class":2776},[2751,4327,4328,4330,4332,4334,4336],{"class":2753,"line":2880},[2751,4329,2916],{"class":2757},[2751,4331,4210],{"class":2787},[2751,4333,4213],{"class":2776},[2751,4335,396],{"class":2851},[2751,4337,4218],{"class":2776},[2751,4339,4340],{"class":2753,"line":2895},[2751,4341,2927],{"class":2776},[2702,4343,2705,4345,1895],{"id":4344},"noncompliant-code-example-snprintf",[98,4346,4347],{},"snprintf()",[39,4349,3158,4350,4352,4353,4359,4360,4363,4364,4368],{},[98,4351,4347],{}," is assumed to succeed. However, if the call fails (for example, because of insufficient memory, as described in GNU libc bug ",[43,4354,4358],{"href":4355,"rel":4356},"http:\u002F\u002Fbugzilla.redhat.com\u002Fshow_bug.cgi?id=441945",[4357],"nofollow","441945"," ), the subsequent call to ",[98,4361,4362],{},"log_message()"," has ",[43,4365,4367],{"href":4366},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fcc-undefined-behavior#CC.UndefinedBehavior-ub_174","undefined behavior 174"," because the character buffer is uninitialized and need not be null-terminated.",[2738,4370,4371],{"quality":2740},[2742,4372,4374],{"className":2744,"code":4373,"language":2746,"meta":2747,"style":2747},"#include \u003Cstdio.h>\n \nextern void log_message(const char *);\n\nvoid f(int i, int width, int prec) {\n  char buf[40];\n  snprintf(buf, sizeof(buf), \"i = %*.*i\", width, prec, i);\n  log_message(buf);\n  \u002F* ... *\u002F\n}\n",[98,4375,4376,4382,4386,4407,4411,4441,4457,4482,4490,4494],{"__ignoreMap":2747},[2751,4377,4378,4380],{"class":2753,"line":2754},[2751,4379,2758],{"class":2757},[2751,4381,4148],{"class":2761},[2751,4383,4384],{"class":2753,"line":2765},[2751,4385,2777],{"class":2776},[2751,4387,4388,4391,4394,4397,4399,4401,4403,4405],{"class":2753,"line":2773},[2751,4389,4390],{"class":2757},"extern",[2751,4392,4393],{"class":2783}," void",[2751,4395,4396],{"class":2787}," log_message",[2751,4398,2791],{"class":2776},[2751,4400,2815],{"class":2757},[2751,4402,2818],{"class":2783},[2751,4404,2798],{"class":2757},[2751,4406,2892],{"class":2776},[2751,4408,4409],{"class":2753,"line":2780},[2751,4410,3090],{"emptyLinePlaceholder":7},[2751,4412,4413,4415,4418,4420,4422,4425,4427,4429,4432,4434,4436,4439],{"class":2753,"line":2828},[2751,4414,3260],{"class":2783},[2751,4416,4417],{"class":2787}," f",[2751,4419,2791],{"class":2776},[2751,4421,2784],{"class":2783},[2751,4423,4424],{"class":2801}," i",[2751,4426,2804],{"class":2776},[2751,4428,2784],{"class":2783},[2751,4430,4431],{"class":2801}," width",[2751,4433,2804],{"class":2776},[2751,4435,2784],{"class":2783},[2751,4437,4438],{"class":2801}," prec",[2751,4440,2839],{"class":2776},[2751,4442,4443,4445,4448,4451,4454],{"class":2753,"line":2842},[2751,4444,3239],{"class":2783},[2751,4446,4447],{"class":3242}," buf",[2751,4449,4450],{"class":2776},"[",[2751,4452,4453],{"class":2851},"40",[2751,4455,4456],{"class":2776},"];\n",[2751,4458,4459,4462,4464,4467,4470,4473,4476,4479],{"class":2753,"line":2860},[2751,4460,4461],{"class":2787},"  snprintf",[2751,4463,4213],{"class":2776},[2751,4465,4466],{"class":2757},"sizeof",[2751,4468,4469],{"class":2776},"(buf), ",[2751,4471,4472],{"class":2761},"\"i = ",[2751,4474,4475],{"class":2851},"%*.*i",[2751,4477,4478],{"class":2761},"\"",[2751,4480,4481],{"class":2776},", width, prec, i);\n",[2751,4483,4484,4487],{"class":2753,"line":2874},[2751,4485,4486],{"class":2787},"  log_message",[2751,4488,4489],{"class":2776},"(buf);\n",[2751,4491,4492],{"class":2753,"line":2880},[2751,4493,3496],{"class":3358},[2751,4495,4496],{"class":2753,"line":2895},[2751,4497,2927],{"class":2776},[2702,4499,2931,4501,1895],{"id":4500},"compliant-solution-snprintf",[98,4502,4347],{},[39,4504,4505,4506,4508,4509,4511,4512,4514],{},"This compliant solution does not assume that ",[98,4507,4347],{}," will succeed regardless of its arguments. It tests the return value of ",[98,4510,4347],{}," before subsequently using the formatted buffer. This compliant solution also treats the case where the static buffer is not large enough for ",[98,4513,4347],{}," to append the terminating null character as an error.",[2738,4516,4517],{"quality":2945},[2742,4518,4520],{"className":2744,"code":4519,"language":2746,"meta":2747,"style":2747},"#include \u003Cstdio.h>\n#include \u003Cstring.h>\n \nextern void log_message(const char *);\n\nvoid f(int i, int width, int prec) {\n  char buf[40];\n  int n;\n  n = snprintf(buf, sizeof(buf), \"i = %*.*i\", width, prec, i);\n  if (n \u003C 0 || n >= sizeof(buf)) {\n    \u002F* Handle snprintf() error *\u002F\n    strcpy(buf, \"unknown error\");\n  }\n  log_message(buf);\n}\n",[98,4521,4522,4528,4534,4538,4556,4560,4586,4598,4606,4630,4656,4661,4673,4677,4683],{"__ignoreMap":2747},[2751,4523,4524,4526],{"class":2753,"line":2754},[2751,4525,2758],{"class":2757},[2751,4527,4148],{"class":2761},[2751,4529,4530,4532],{"class":2753,"line":2765},[2751,4531,2758],{"class":2757},[2751,4533,3199],{"class":2761},[2751,4535,4536],{"class":2753,"line":2773},[2751,4537,2777],{"class":2776},[2751,4539,4540,4542,4544,4546,4548,4550,4552,4554],{"class":2753,"line":2780},[2751,4541,4390],{"class":2757},[2751,4543,4393],{"class":2783},[2751,4545,4396],{"class":2787},[2751,4547,2791],{"class":2776},[2751,4549,2815],{"class":2757},[2751,4551,2818],{"class":2783},[2751,4553,2798],{"class":2757},[2751,4555,2892],{"class":2776},[2751,4557,4558],{"class":2753,"line":2828},[2751,4559,3090],{"emptyLinePlaceholder":7},[2751,4561,4562,4564,4566,4568,4570,4572,4574,4576,4578,4580,4582,4584],{"class":2753,"line":2842},[2751,4563,3260],{"class":2783},[2751,4565,4417],{"class":2787},[2751,4567,2791],{"class":2776},[2751,4569,2784],{"class":2783},[2751,4571,4424],{"class":2801},[2751,4573,2804],{"class":2776},[2751,4575,2784],{"class":2783},[2751,4577,4431],{"class":2801},[2751,4579,2804],{"class":2776},[2751,4581,2784],{"class":2783},[2751,4583,4438],{"class":2801},[2751,4585,2839],{"class":2776},[2751,4587,4588,4590,4592,4594,4596],{"class":2753,"line":2860},[2751,4589,3239],{"class":2783},[2751,4591,4447],{"class":3242},[2751,4593,4450],{"class":2776},[2751,4595,4453],{"class":2851},[2751,4597,4456],{"class":2776},[2751,4599,4600,4603],{"class":2753,"line":2874},[2751,4601,4602],{"class":2783},"  int",[2751,4604,4605],{"class":2776}," n;\n",[2751,4607,4608,4611,4613,4616,4618,4620,4622,4624,4626,4628],{"class":2753,"line":2880},[2751,4609,4610],{"class":2776},"  n ",[2751,4612,2904],{"class":2757},[2751,4614,4615],{"class":2787}," snprintf",[2751,4617,4213],{"class":2776},[2751,4619,4466],{"class":2757},[2751,4621,4469],{"class":2776},[2751,4623,4472],{"class":2761},[2751,4625,4475],{"class":2851},[2751,4627,4478],{"class":2761},[2751,4629,4481],{"class":2776},[2751,4631,4632,4634,4637,4639,4641,4644,4647,4650,4653],{"class":2753,"line":2895},[2751,4633,2845],{"class":2757},[2751,4635,4636],{"class":2776}," (n ",[2751,4638,3409],{"class":2757},[2751,4640,2919],{"class":2851},[2751,4642,4643],{"class":2757}," ||",[2751,4645,4646],{"class":2776}," n ",[2751,4648,4649],{"class":2757},">=",[2751,4651,4652],{"class":2757}," sizeof",[2751,4654,4655],{"class":2776},"(buf)) {\n",[2751,4657,4658],{"class":2753,"line":2913},[2751,4659,4660],{"class":3358},"    \u002F* Handle snprintf() error *\u002F\n",[2751,4662,4663,4666,4668,4671],{"class":2753,"line":2924},[2751,4664,4665],{"class":2787},"    strcpy",[2751,4667,4213],{"class":2776},[2751,4669,4670],{"class":2761},"\"unknown error\"",[2751,4672,2892],{"class":2776},[2751,4674,4675],{"class":2753,"line":3087},[2751,4676,2877],{"class":2776},[2751,4678,4679,4681],{"class":2753,"line":3093},[2751,4680,4486],{"class":2787},[2751,4682,4489],{"class":2776},[2751,4684,4685],{"class":2753,"line":3106},[2751,4686,2927],{"class":2776},[2702,4688,2931,4690,4693,4694,1895],{"id":4689},"compliant-solution-snprintf-null",[98,4691,4692],{},"snprintf("," null ",[98,4695,3320],{},[39,4697,4698,4699,4701,4702,4704],{},"If unknown, the length of the formatted string can be discovered by invoking ",[98,4700,4347],{}," with a null buffer pointer to determine the size required for the output, then dynamically allocating a buffer of sufficient size, and finally calling ",[98,4703,4347],{}," again to format the output into the dynamically allocated buffer. Even with this approach, the success of all calls still needs to be tested, and any errors must be appropriately handled. A possible optimization is to first attempt to format the string into a reasonably small buffer allocated on the stack and, only when the buffer turns out to be too small, dynamically allocate one of a sufficient size:",[2738,4706,4707],{"quality":2945},[2742,4708,4710],{"className":2744,"code":4709,"language":2746,"meta":2747,"style":2747},"#include \u003Cstdio.h>\n#include \u003Cstdlib.h>\n#include \u003Cstring.h>\n \nextern void log_message(const char *); \n \nvoid f(int i, int width, int prec) {\n  char buffer[20];\n  char *buf = buffer;\n  int n  = sizeof(buffer);\n  const char fmt[] = \"i = %*.*i\";\n\n  n = snprintf(buf, n, fmt, width, prec, i);\n  if (n \u003C 0) {\n    \u002F* Handle snprintf() error *\u002F\n    strcpy(buffer, \"unknown error\");\n    goto write_log;\n  }\n\n  if (n \u003C sizeof(buffer)) {\n    goto write_log;\n  }\n\n  buf = (char *)malloc(n + 1);\n  if (NULL == buf) {\n    \u002F* Handle malloc() error *\u002F\n    strcpy(buffer, \"unknown error\");\n    goto write_log;\n  }\n\n  n = snprintf(buf, n, fmt, width, prec, i);\n  if (n \u003C 0) {\n    \u002F* Handle snprintf() error *\u002F\n    strcpy(buffer, \"unknown error\");\n  }\n\nwrite_log:\n  log_message(buf);\n\n  if (buf != buffer) {\n    free(buf);\n  }\n}\n",[98,4711,4712,4718,4724,4730,4734,4753,4757,4783,4797,4811,4825,4849,4853,4864,4876,4880,4891,4899,4903,4907,4920,4926,4930,4934,4962,4975,4980,4990,4996,5000,5005,5016,5029,5034,5045,5050,5055,5061,5068,5073,5086,5094,5099],{"__ignoreMap":2747},[2751,4713,4714,4716],{"class":2753,"line":2754},[2751,4715,2758],{"class":2757},[2751,4717,4148],{"class":2761},[2751,4719,4720,4722],{"class":2753,"line":2765},[2751,4721,2758],{"class":2757},[2751,4723,2770],{"class":2761},[2751,4725,4726,4728],{"class":2753,"line":2773},[2751,4727,2758],{"class":2757},[2751,4729,3199],{"class":2761},[2751,4731,4732],{"class":2753,"line":2780},[2751,4733,2777],{"class":2776},[2751,4735,4736,4738,4740,4742,4744,4746,4748,4750],{"class":2753,"line":2828},[2751,4737,4390],{"class":2757},[2751,4739,4393],{"class":2783},[2751,4741,4396],{"class":2787},[2751,4743,2791],{"class":2776},[2751,4745,2815],{"class":2757},[2751,4747,2818],{"class":2783},[2751,4749,2798],{"class":2757},[2751,4751,4752],{"class":2776},"); \n",[2751,4754,4755],{"class":2753,"line":2842},[2751,4756,2777],{"class":2776},[2751,4758,4759,4761,4763,4765,4767,4769,4771,4773,4775,4777,4779,4781],{"class":2753,"line":2860},[2751,4760,3260],{"class":2783},[2751,4762,4417],{"class":2787},[2751,4764,2791],{"class":2776},[2751,4766,2784],{"class":2783},[2751,4768,4424],{"class":2801},[2751,4770,2804],{"class":2776},[2751,4772,2784],{"class":2783},[2751,4774,4431],{"class":2801},[2751,4776,2804],{"class":2776},[2751,4778,2784],{"class":2783},[2751,4780,4438],{"class":2801},[2751,4782,2839],{"class":2776},[2751,4784,4785,4787,4790,4792,4795],{"class":2753,"line":2874},[2751,4786,3239],{"class":2783},[2751,4788,4789],{"class":3242}," buffer",[2751,4791,4450],{"class":2776},[2751,4793,4794],{"class":2851},"20",[2751,4796,4456],{"class":2776},[2751,4798,4799,4801,4803,4806,4808],{"class":2753,"line":2880},[2751,4800,3239],{"class":2783},[2751,4802,2798],{"class":2757},[2751,4804,4805],{"class":2776},"buf ",[2751,4807,2904],{"class":2757},[2751,4809,4810],{"class":2776}," buffer;\n",[2751,4812,4813,4815,4818,4820,4822],{"class":2753,"line":2895},[2751,4814,4602],{"class":2783},[2751,4816,4817],{"class":2776}," n  ",[2751,4819,2904],{"class":2757},[2751,4821,4652],{"class":2757},[2751,4823,4824],{"class":2776},"(buffer);\n",[2751,4826,4827,4829,4831,4834,4837,4840,4843,4845,4847],{"class":2753,"line":2913},[2751,4828,3039],{"class":2757},[2751,4830,2818],{"class":2783},[2751,4832,4833],{"class":2776}," fmt",[2751,4835,4836],{"class":2757},"[]",[2751,4838,4839],{"class":2757}," =",[2751,4841,4842],{"class":2761}," \"i = ",[2751,4844,4475],{"class":2851},[2751,4846,4478],{"class":2761},[2751,4848,2871],{"class":2776},[2751,4850,4851],{"class":2753,"line":2924},[2751,4852,3090],{"emptyLinePlaceholder":7},[2751,4854,4855,4857,4859,4861],{"class":2753,"line":3087},[2751,4856,4610],{"class":2776},[2751,4858,2904],{"class":2757},[2751,4860,4615],{"class":2787},[2751,4862,4863],{"class":2776},"(buf, n, fmt, width, prec, i);\n",[2751,4865,4866,4868,4870,4872,4874],{"class":2753,"line":3093},[2751,4867,2845],{"class":2757},[2751,4869,4636],{"class":2776},[2751,4871,3409],{"class":2757},[2751,4873,2919],{"class":2851},[2751,4875,2839],{"class":2776},[2751,4877,4878],{"class":2753,"line":3106},[2751,4879,4660],{"class":3358},[2751,4881,4882,4884,4887,4889],{"class":2753,"line":3122},[2751,4883,4665],{"class":2787},[2751,4885,4886],{"class":2776},"(buffer, ",[2751,4888,4670],{"class":2761},[2751,4890,2892],{"class":2776},[2751,4892,4893,4896],{"class":2753,"line":3133},[2751,4894,4895],{"class":2757},"    goto",[2751,4897,4898],{"class":2776}," write_log;\n",[2751,4900,4901],{"class":2753,"line":3138},[2751,4902,2877],{"class":2776},[2751,4904,4905],{"class":2753,"line":3147},[2751,4906,3090],{"emptyLinePlaceholder":7},[2751,4908,4909,4911,4913,4915,4917],{"class":2753,"line":3415},[2751,4910,2845],{"class":2757},[2751,4912,4636],{"class":2776},[2751,4914,3409],{"class":2757},[2751,4916,4652],{"class":2757},[2751,4918,4919],{"class":2776},"(buffer)) {\n",[2751,4921,4922,4924],{"class":2753,"line":3420},[2751,4923,4895],{"class":2757},[2751,4925,4898],{"class":2776},[2751,4927,4928],{"class":2753,"line":3425},[2751,4929,2877],{"class":2776},[2751,4931,4932],{"class":2753,"line":3430},[2751,4933,3090],{"emptyLinePlaceholder":7},[2751,4935,4936,4939,4941,4943,4946,4948,4950,4953,4956,4958,4960],{"class":2753,"line":3458},[2751,4937,4938],{"class":2776},"  buf ",[2751,4940,2904],{"class":2757},[2751,4942,2848],{"class":2776},[2751,4944,4945],{"class":2783},"char",[2751,4947,2798],{"class":2757},[2751,4949,3320],{"class":2776},[2751,4951,4952],{"class":2787},"malloc",[2751,4954,4955],{"class":2776},"(n ",[2751,4957,3445],{"class":2757},[2751,4959,3453],{"class":2851},[2751,4961,2892],{"class":2776},[2751,4963,4964,4966,4968,4970,4972],{"class":2753,"line":3467},[2751,4965,2845],{"class":2757},[2751,4967,2848],{"class":2776},[2751,4969,108],{"class":2851},[2751,4971,2854],{"class":2757},[2751,4973,4974],{"class":2776}," buf) {\n",[2751,4976,4977],{"class":2753,"line":3493},[2751,4978,4979],{"class":3358},"    \u002F* Handle malloc() error *\u002F\n",[2751,4981,4982,4984,4986,4988],{"class":2753,"line":3499},[2751,4983,4665],{"class":2787},[2751,4985,4886],{"class":2776},[2751,4987,4670],{"class":2761},[2751,4989,2892],{"class":2776},[2751,4991,4992,4994],{"class":2753,"line":3508},[2751,4993,4895],{"class":2757},[2751,4995,4898],{"class":2776},[2751,4997,4998],{"class":2753,"line":3831},[2751,4999,2877],{"class":2776},[2751,5001,5003],{"class":2753,"line":5002},30,[2751,5004,3090],{"emptyLinePlaceholder":7},[2751,5006,5008,5010,5012,5014],{"class":2753,"line":5007},31,[2751,5009,4610],{"class":2776},[2751,5011,2904],{"class":2757},[2751,5013,4615],{"class":2787},[2751,5015,4863],{"class":2776},[2751,5017,5019,5021,5023,5025,5027],{"class":2753,"line":5018},32,[2751,5020,2845],{"class":2757},[2751,5022,4636],{"class":2776},[2751,5024,3409],{"class":2757},[2751,5026,2919],{"class":2851},[2751,5028,2839],{"class":2776},[2751,5030,5032],{"class":2753,"line":5031},33,[2751,5033,4660],{"class":3358},[2751,5035,5037,5039,5041,5043],{"class":2753,"line":5036},34,[2751,5038,4665],{"class":2787},[2751,5040,4886],{"class":2776},[2751,5042,4670],{"class":2761},[2751,5044,2892],{"class":2776},[2751,5046,5048],{"class":2753,"line":5047},35,[2751,5049,2877],{"class":2776},[2751,5051,5053],{"class":2753,"line":5052},36,[2751,5054,3090],{"emptyLinePlaceholder":7},[2751,5056,5058],{"class":2753,"line":5057},37,[2751,5059,5060],{"class":2776},"write_log:\n",[2751,5062,5064,5066],{"class":2753,"line":5063},38,[2751,5065,4486],{"class":2787},[2751,5067,4489],{"class":2776},[2751,5069,5071],{"class":2753,"line":5070},39,[2751,5072,3090],{"emptyLinePlaceholder":7},[2751,5074,5076,5078,5081,5083],{"class":2753,"line":5075},40,[2751,5077,2845],{"class":2757},[2751,5079,5080],{"class":2776}," (buf ",[2751,5082,4304],{"class":2757},[2751,5084,5085],{"class":2776}," buffer) {\n",[2751,5087,5089,5092],{"class":2753,"line":5088},41,[2751,5090,5091],{"class":2787},"    free",[2751,5093,4489],{"class":2776},[2751,5095,5097],{"class":2753,"line":5096},42,[2751,5098,2877],{"class":2776},[2751,5100,5102],{"class":2753,"line":5101},43,[2751,5103,2927],{"class":2776},[39,5105,5106,5107,5110,5111,392,5115,2675],{},"This solution uses the ",[98,5108,5109],{},"goto"," statement, as suggested in ",[43,5112,5114],{"href":5113},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmemory-management-mem\u002Fmem12-c","MEM12-C",[43,5116,5117],{"href":5113},". Consider using a goto chain when leaving a function on error when using and releasing resources",[2702,5119,5121],{"id":5120},"exceptions","Exceptions",[39,5123,5124,5127],{},[59,5125,5126],{},"ERR33-C-EX1:"," It is acceptable to ignore the return value of a function if:",[5129,5130,5131,5135,5138],"ul",{},[5132,5133,5134],"li",{},"that function cannot fail.",[5132,5136,5137],{},"its return value is inconsequential; that is, it does not indicate an error.",[5132,5139,5140],{},"it is one of a handful of functions whose return values are not traditionally checked.",[39,5142,5143],{},"These functions are listed in the following table:",[39,5145,5146],{},[59,5147,5148],{},"Functions for which Return Values Need Not Be Checked",[63,5150,5151,5161],{},[66,5152,5153],{},[69,5154,5155,5157,5159],{},[72,5156],{},[72,5158],{},[72,5160],{},[79,5162,5163,5171,5184,5197,5210,5223,5238,5252,5265,5280,5294,5308,5322,5336,5350],{},[69,5164,5165,5167,5169],{},[84,5166,86],{},[84,5168,89],{},[84,5170,92],{},[69,5172,5173,5178,5180],{},[84,5174,5175],{},[98,5176,5177],{},"      putchar       ()     ",[84,5179,504],{},[84,5181,5182],{},[98,5183,391],{},[69,5185,5186,5191,5193],{},[84,5187,5188],{},[98,5189,5190],{},"      putwchar       ()     ",[84,5192,535],{},[84,5194,5195],{},[98,5196,191],{},[69,5198,5199,5204,5206],{},[84,5200,5201],{},[98,5202,5203],{},"      puts       ()     ",[84,5205,521],{},[84,5207,5208,361],{},[98,5209,391],{},[69,5211,5212,5217,5219],{},[84,5213,5214],{},[98,5215,5216],{},"putws()",[84,5218,521],{},[84,5220,5221],{},[98,5222,191],{},[69,5224,5225,5234,5236],{},[84,5226,5227,5230,5231],{},[98,5228,5229],{},"      printf       ()     ",",",[98,5232,5233],{},"      vprintf       ()     ",[84,5235,480],{},[84,5237,483],{},[69,5239,5240,5248,5250],{},[84,5241,5242,5230,5245],{},[98,5243,5244],{},"      wprintf       ()     ",[98,5246,5247],{},"      vwprintf       ()     ",[84,5249,673],{},[84,5251,483],{},[69,5253,5254,5259,5262],{},[84,5255,5256],{},[98,5257,5258],{},"kill_dependency()",[84,5260,5261],{},"The input parameter",[84,5263,5264],{},"NA",[69,5266,5267,5275,5278],{},[84,5268,5269,661,5272],{},[98,5270,5271],{},"memcpy()",[98,5273,5274],{},"wmemcpy()",[84,5276,5277],{},"The destination input parameter",[84,5279,5264],{},[69,5281,5282,5290,5292],{},[84,5283,5284,661,5287],{},[98,5285,5286],{},"memmove()",[98,5288,5289],{},"wmemmove()",[84,5291,5277],{},[84,5293,5264],{},[69,5295,5296,5304,5306],{},[84,5297,5298,661,5301],{},[98,5299,5300],{},"strcpy()",[98,5302,5303],{},"wcscpy()",[84,5305,5277],{},[84,5307,5264],{},[69,5309,5310,5318,5320],{},[84,5311,5312,661,5315],{},[98,5313,5314],{},"strncpy()",[98,5316,5317],{},"wcsncpy()",[84,5319,5277],{},[84,5321,5264],{},[69,5323,5324,5332,5334],{},[84,5325,5326,661,5329],{},[98,5327,5328],{},"strcat()",[98,5330,5331],{},"wcscat()",[84,5333,5277],{},[84,5335,5264],{},[69,5337,5338,5346,5348],{},[84,5339,5340,661,5343],{},[98,5341,5342],{},"strncat()",[98,5344,5345],{},"wcsncat()",[84,5347,5277],{},[84,5349,5264],{},[69,5351,5352,5360,5362],{},[84,5353,5354,661,5357],{},[98,5355,5356],{},"memset()",[98,5358,5359],{},"wmemset()",[84,5361,5277],{},[84,5363,5264],{},[39,5365,5366,5367,5370,5371,661,5374,661,5377,5380,5381,661,5384,661,5386,661,5389,5392,5393,47,5396,5399],{},"The return value of a call to ",[98,5368,5369],{},"fprintf()"," or one of its variants ( ",[98,5372,5373],{},"vfprintf()",[98,5375,5376],{},"wfprintf()",[98,5378,5379],{},"vwfprintf()"," ) or one of the file output functions ",[98,5382,5383],{},"fputc()",[98,5385,532],{},[98,5387,5388],{},"fputs()",[98,5390,5391],{},"fputws()"," may be ignored if the output is being directed to ",[98,5394,5395],{},"stdout",[98,5397,5398],{},"stderr"," . Otherwise, the return value must be checked.",[39,5401,5402],{},"If a function's return value is to be ignored, it is recommended that the function's return value should be explicitly cast to void to signify the programmer's intent:",[2738,5404,5405],{"quality":2945},[2742,5406,5408],{"className":2744,"code":5407,"language":2746,"meta":2747,"style":2747},"int main() {\n  (void) fprintf(stdout, \"Hello, world\\n\"); \u002F\u002F fprintf() return value safely ignored\n}\n",[98,5409,5410,5420,5450],{"__ignoreMap":2747},[2751,5411,5412,5414,5417],{"class":2753,"line":2754},[2751,5413,2784],{"class":2783},[2751,5415,5416],{"class":2787}," main",[2751,5418,5419],{"class":2776},"() {\n",[2751,5421,5422,5425,5427,5430,5433,5436,5439,5442,5444,5447],{"class":2753,"line":2765},[2751,5423,5424],{"class":2776},"  (",[2751,5426,3260],{"class":2783},[2751,5428,5429],{"class":2776},") ",[2751,5431,5432],{"class":2787},"fprintf",[2751,5434,5435],{"class":2776},"(stdout, ",[2751,5437,5438],{"class":2761},"\"Hello, world",[2751,5440,5441],{"class":2851},"\\n",[2751,5443,4478],{"class":2761},[2751,5445,5446],{"class":2776},");",[2751,5448,5449],{"class":3358}," \u002F\u002F fprintf() return value safely ignored\n",[2751,5451,5452],{"class":2753,"line":2773},[2751,5453,2927],{"class":2776},[2702,5455,5457],{"id":5456},"risk-assessment","Risk Assessment",[39,5459,5460,5461,2658,5465,5469],{},"Failing to detect error conditions can lead to unpredictable results, including ",[43,5462,5464],{"href":5463},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fbb-definitions#BB.Definitions-abnormaltermination","abnormal program termination",[43,5466,5468],{"href":5467},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fbb-definitions#BB.Definitions-denial-of-service","denial-of-service attacks"," or, in some situations, could even allow an attacker to run arbitrary code.",[63,5471,5472,5473,5472,5500],{},"\n  ",[66,5474,5475,5476,5472],{},"\n    ",[69,5477,5478,5479,5478,5482,5478,5485,5478,5488,5478,5491,5478,5494,5478,5497,5475],{},"\n      ",[72,5480,5481],{},"Rule",[72,5483,5484],{},"Severity",[72,5486,5487],{},"Likelihood",[72,5489,5490],{},"Detectable",[72,5492,5493],{},"Repairable",[72,5495,5496],{},"Priority",[72,5498,5499],{},"Level",[79,5501,5475,5502,5472],{},[69,5503,5478,5504,5478,5507,5478,5510,5478,5513,5478,5516,5478,5518,5478,5525,5475],{},[84,5505,5506],{},"ERR33-C",[84,5508,5509],{},"High",[84,5511,5512],{},"Likely",[84,5514,5515],{},"Yes",[84,5517,5515],{},[84,5519,5521],{"style":5520},"color: #e74c3c;",[5522,5523,5524],"b",{},"P27",[84,5526,5527],{"style":5520},[5522,5528,5529],{},"L1",[5531,5532,5534],"h3",{"id":5533},"automated-detection","Automated Detection",[63,5536,5539],{"className":5537},[5538],"wrapped",[79,5540,5541,5565,5595,5622,5661,5694,5735,5761,5799,5834,5859,5898,5917,5946,5996,6018],{},[69,5542,5545,5550,5555,5560],{"className":5543},[5544],"header",[72,5546,5547],{},[39,5548,5549],{},"Tool",[72,5551,5552],{},[39,5553,5554],{},"Version",[72,5556,5557],{},[39,5558,5559],{},"Checker",[72,5561,5562],{},[39,5563,5564],{},"Description",[69,5566,5569,5575,5583,5592],{"className":5567},[5568],"odd",[84,5570,5571],{},[43,5572,5574],{"href":5573},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fastree","Astrée",[84,5576,5577],{},[5578,5579,5582],"div",{"className":5580},[5581],"content-wrapper","25.10",[84,5584,5585],{},[59,5586,5587,5588,5591],{},"error-information-unused",[5589,5590],"br",{},"\nerror-information-unused-computed",[84,5593,5594],{},"Partially checked",[69,5596,5599,5605,5613,5618],{"className":5597},[5598],"even",[84,5600,5601],{},[43,5602,5604],{"href":5603},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Faxivion-bauhaus-suite","Axivion Bauhaus Suite",[84,5606,5607],{},[5578,5608,5610],{"className":5609},[5581],[39,5611,5612],{},"7.2.0",[84,5614,5615],{},[59,5616,5617],{},"CertC-ERR33",[84,5619,5620],{},[5589,5621],{},[69,5623,5625,5631,5637,5652],{"className":5624},[5568],[84,5626,5627],{},[43,5628,5630],{"href":5629},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fcodesonar","CodeSonar",[84,5632,5633],{},[5578,5634,5636],{"className":5635},[5581],"9.1p0",[84,5638,5639],{},[39,5640,5641],{},[59,5642,5643,5644,5646,5647,5649,5650],{},"LANG.FUNCS.IRV",[5589,5645],{},"\nLANG.ERRCODE.NOTEST",[5589,5648],{},"\nLANG.ERRCODE.NZ",[5589,5651],{},[84,5653,5654,5655,5657,5658,5660],{},"Ignored return value",[5589,5656],{},"\nMissing Test of Error Code",[5589,5659],{},"\nNon-zero Error Code",[69,5662,5664,5670,5674,5678],{"className":5663},[5598],[84,5665,5666],{},[43,5667,5669],{"href":5668},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Frose","Compass\u002FROSE",[84,5671,5672],{},[5589,5673],{},[84,5675,5676],{},[5589,5677],{},[84,5679,5680],{},[39,5681,5682,5683,2658,5687,392,5691],{},"Can detect violations of this recommendation when checking for violations of ",[43,5684,5686],{"href":5685},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp\u002Fexp12-c","EXP12-C. Do not ignore values returned by functions",[43,5688,5690],{"href":5689},"https:\u002F\u002Fwww.securecoding.cert.org\u002Fconfluence\u002Fdisplay\u002Fseccode\u002FEXP34-C.+Do+not+dereference+null+pointers","EXP34-C",[43,5692,5693],{"href":5689},". Do not dereference null pointers",[69,5695,5697,5703,5709,5732],{"className":5696},[5568],[84,5698,5699],{},[43,5700,5702],{"href":5701},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fcoverity","Coverity",[84,5704,5705],{},[5578,5706,5708],{"className":5707},[5581],"2017.07",[84,5710,5711,5716,5723],{},[39,5712,5713],{},[59,5714,5715],{},"MISRA C 2012 Rule 22.8",[39,5717,5718],{},[59,5719,5720],{},[59,5721,5722],{},"MISRA C 2012 Rule 22.9",[39,5724,5725],{},[59,5726,5727],{},[59,5728,5729],{},[59,5730,5731],{},"MISRA C 2012 Rule 22.10",[84,5733,5734],{},"Implemented",[69,5736,5738,5744,5752,5757],{"className":5737},[5598],[84,5739,5740],{},[43,5741,5743],{"href":5742},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fcppcheck-premium","Cppcheck Premium",[84,5745,5746],{},[5578,5747,5749],{"className":5748},[5581],[39,5750,5751],{},"24.11.0",[84,5753,5754],{},[59,5755,5756],{},"premium-cert-err33-c",[84,5758,5759],{},[5589,5760],{},[69,5762,5764,5770,5778,5795],{"className":5763},[5568],[84,5765,5766],{},[43,5767,5769],{"href":5768},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fhelix-qac","Helix QAC",[84,5771,5772],{},[5578,5773,5775],{"className":5774},[5581],[39,5776,5777],{},"2025.2",[84,5779,5780,5785,5790],{},[39,5781,5782],{},[59,5783,5784],{},"C3200",[39,5786,5787],{},[59,5788,5789],{},"C++3802, C++3803, C++3804",[39,5791,5792],{},[59,5793,5794],{},"DF2820, DF2821, DF2822, DF2823, DF2824, DF2930, DF2931, DF2932, DF2933, DF2934",[84,5796,5797],{},[5589,5798],{},[69,5800,5802,5808,5813,5830],{"className":5801},[5598],[84,5803,5804],{},[43,5805,5807],{"href":5806},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fklocwork","Klocwork",[84,5809,5810],{},[5578,5811,5777],{"className":5812},[5581],[84,5814,5815],{},[39,5816,5817,5820,5822,5825,5827],{},[59,5818,5819],{},"NPD.CHECK.MUST",[5589,5821],{},[59,5823,5824],{},"NPD.FUNC.MUST",[5589,5826],{},[59,5828,5829],{},"SV.RVT.RETVAL_NOTTESTED",[84,5831,5832],{},[5589,5833],{},[69,5835,5837,5843,5849,5856],{"className":5836},[5568],[84,5838,5839],{},[43,5840,5842],{"href":5841},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fldra","LDRA tool suite",[84,5844,5845],{},[5578,5846,5848],{"className":5847},[5581],"9.7.1",[84,5850,5851],{},[39,5852,5853],{},[59,5854,5855],{},"80 D",[84,5857,5858],{},"Partially implemented",[69,5860,5862,5868,5870,5887],{"className":5861},[5598],[84,5863,5864],{},[43,5865,5867],{"href":5866},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fparasoft","Parasoft C\u002FC++test",[84,5869,5777],{},[84,5871,5872],{},[39,5873,5874,5877,5879],{},[59,5875,5876],{},"CERT_C-ERR33-a",[5589,5878],{},[59,5880,5881,5882,5884,5885],{},"CERT_C-ERR33-d",[5589,5883],{},"\nCERT_C-ERR33-e",[5589,5886],{},[84,5888,5889],{},[39,5890,5891,5892,5894,5895,5897],{},"The value returned by a standard library function that may return an error should be used",[5589,5893],{},"\nAlways check the returned value of non-void function",[5589,5896],{},"\nProvide error handling for file opening errors right next to the call to fopen",[69,5899,5901,5906,5910,5914],{"className":5900},[5568],[84,5902,5903],{},[43,5904,5905],{"href":5866},"Parasoft Insure++",[84,5907,5908],{},[5589,5909],{},[84,5911,5912],{},[5589,5913],{},[84,5915,5916],{},"Runtime analysis",[69,5918,5920,5926,5934,5941],{"className":5919},[5598],[84,5921,5922],{},[43,5923,5925],{"href":5924},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fpc-lint-plus","PC-lint Plus",[84,5927,5928],{},[5578,5929,5931],{"className":5930},[5581],[39,5932,5933],{},"1.4",[84,5935,5936],{},[39,5937,5938],{},[59,5939,5940],{},"534",[84,5942,5943],{},[39,5944,5945],{},"Partially supported",[69,5947,5949,5957,5965,5977],{"className":5948},[5568],[84,5950,5951],{},[39,5952,5953],{},[43,5954,5956],{"href":5955},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fpolyspace-bug-finder","Polyspace Bug Finder",[84,5958,5959],{},[5578,5960,5962],{"className":5961},[5581],[39,5963,5964],{},"R2025b",[84,5966,5967,5973],{},[39,5968,5969],{},[43,5970,5972],{"href":5971},"https:\u002F\u002Fwww.mathworks.com\u002Fhelp\u002Fbugfinder\u002Fref\u002Fcertcruleerr33c.html","CERT C: Rule ERR33-C",[39,5974,5975],{},[5589,5976],{},[84,5978,5979,5982,5993],{},[39,5980,5981],{},"Checks for:",[5129,5983,5984,5987,5990],{},[5132,5985,5986],{},"Errno not checked",[5132,5988,5989],{},"Return value of a sensitive function not checked",[5132,5991,5992],{},"Unprotected dynamic memory allocation",[39,5994,5995],{},"Rule partially covered.",[69,5997,5999,6005,6012,6016],{"className":5998},[5598],[84,6000,6001],{},[43,6002,6004],{"href":6003},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Frulechecker","RuleChecker",[84,6006,6007],{},[5578,6008,6010],{"className":6009},[5581],[39,6011,5582],{},[84,6013,6014],{},[59,6015,5587],{},[84,6017,5594],{},[69,6019,6021,6027,6035,6040],{"className":6020},[5568],[84,6022,6023],{},[43,6024,6026],{"href":6025},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Ftrustinsoft-analyzer","TrustInSoft Analyzer",[84,6028,6029],{},[5578,6030,6032],{"className":6031},[5581],[39,6033,6034],{},"1.38",[84,6036,6037],{},[59,6038,6039],{},"pointer arithmetic",[84,6041,6042],{},"Exhaustively verified.",[5531,6044,6046],{"id":6045},"related-vulnerabilities","Related Vulnerabilities",[39,6048,2668,6049,6051,6052,6056,6057,6059,6060,6062,6063,6067],{},[43,6050,3537],{"href":3536}," in Adobe Flash [ ",[43,6053,6055],{"href":6054},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Faa-bibliography#AA.Bibliography-VU#159523","VU#159523"," ] arises because Flash neglects to check the return value from ",[98,6058,3155],{}," . Even when ",[98,6061,3155],{}," returns a null pointer, Flash writes to an offset from the return value. Dereferencing a null pointer usually results in a program crash, but dereferencing an offset from a null pointer allows an ",[43,6064,6066],{"href":6065},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fbb-definitions#BB.Definitions-exploit","exploit"," to succeed without crashing the program.",[39,6069,6070,6071,6074,6075,2675],{},"Search for ",[43,6072,6073],{"href":3536},"vulnerabilities"," resulting from the violation of this rule on the ",[43,6076,6079],{"href":6077,"rel":6078},"https:\u002F\u002Fwww.kb.cert.org\u002Fvulnotes\u002Fbymetric?searchview&query=FIELD+KEYWORDS+contains+ERR33-C",[4357],"CERT website",[2702,6081,6083],{"id":6082},"related-guidelines","Related Guidelines",[39,6085,6086,6090],{},[43,6087,6089],{"href":6088},"\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fhow-this-coding-standard-is-organized#HowthisCodingStandardisOrganized-RelatedGuidelines","Key here"," (explains table format and definitions)",[63,6092,6093,6103],{},[66,6094,6095],{},[69,6096,6097,6099,6101],{},[72,6098],{},[72,6100],{},[72,6102],{},[79,6104,6105,6116,6132,6147,6161,6175,6189,6205,6220,6233,6253,6270],{},[69,6106,6107,6110,6113],{},[84,6108,6109],{},"Taxonomy",[84,6111,6112],{},"Taxonomy item",[84,6114,6115],{},"Relationship",[69,6117,6118,6123,6129],{},[84,6119,6120],{},[43,6121,6122],{"href":17},"CERT C Secure Coding Standard",[84,6124,6125],{},[43,6126,6128],{"href":6127},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ferror-handling-err\u002Ferr00-c","ERR00-C. Adopt and implement a consistent and comprehensive error-handling policy",[84,6130,6131],{},"Prior to 2018-01-12: CERT: Unspecified Relationship",[69,6133,6134,6138,6145],{},[84,6135,6136],{},[43,6137,6122],{"href":17},[84,6139,6140,392,6143],{},[43,6141,5690],{"href":6142},"\u002Fsei-cert-c-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp34-c",[43,6144,5693],{"href":6142},[84,6146,6131],{},[69,6148,6149,6153,6159],{},[84,6150,6151],{},[43,6152,6122],{"href":17},[84,6154,6155,392,6157],{},[43,6156,2696],{"href":2695},[43,6158,2699],{"href":2695},[84,6160,6131],{},[69,6162,6163,6167,6173],{},[84,6164,6165],{},[43,6166,6122],{"href":17},[84,6168,6169,392,6171],{},[43,6170,3962],{"href":3961},[43,6172,3965],{"href":3961},[84,6174,6131],{},[69,6176,6177,6181,6187],{},[84,6178,6179],{},[43,6180,6122],{"href":17},[84,6182,6183,392,6185],{},[43,6184,5114],{"href":5113},[43,6186,5117],{"href":5113},[84,6188,6131],{},[69,6190,6191,6196,6203],{},[84,6192,6193],{},[43,6194,6195],{"href":20},"CERT C",[84,6197,6198],{},[43,6199,6202],{"href":6200,"rel":6201},"https:\u002F\u002Fwiki.sei.cmu.edu\u002Fconfluence\u002Fdisplay\u002Fcplusplus\u002FERR10-CPP.+Check+for+error+conditions",[4357],"ERR10-CPP. Check for error conditions",[84,6204,6131],{},[69,6206,6207,6211,6218],{},[84,6208,6209],{},[43,6210,6195],{"href":20},[84,6212,6213],{},[43,6214,6217],{"href":6215,"rel":6216},"https:\u002F\u002Fwiki.sei.cmu.edu\u002Fconfluence\u002Fdisplay\u002Fcplusplus\u002FFIO04-CPP.+Detect+and+handle+input+and+output+errors",[4357],"FIO04-CPP. Detect and handle input and output errors",[84,6219,6131],{},[69,6221,6222,6228,6231],{},[84,6223,6224],{},[43,6225,6227],{"href":6226},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Faa-bibliography#AA.Bibliography-ISO-IECTS17961","ISO\u002FIEC TS 17961:2013",[84,6229,6230],{},"Failing to detect and handle standard library errors [liberr]",[84,6232,6131],{},[69,6234,6235,6242,6250],{},[84,6236,6237],{},[43,6238,6241],{"href":6239,"rel":6240},"https:\u002F\u002Fcwe.mitre.org\u002Fdata\u002Findex.html",[4357],"CWE 2.11",[84,6243,6244,6249],{},[43,6245,6248],{"href":6246,"rel":6247},"http:\u002F\u002Fcwe.mitre.org\u002Fdata\u002Fdefinitions\u002F252.html",[4357],"CWE-252"," , Unchecked Return Value",[84,6251,6252],{},"2017-07-06: CERT: Partial overlap",[69,6254,6255,6260,6268],{},[84,6256,6257],{},[43,6258,6241],{"href":6239,"rel":6259},[4357],[84,6261,6262,6267],{},[43,6263,6266],{"href":6264,"rel":6265},"http:\u002F\u002Fcwe.mitre.org\u002Fdata\u002Fdefinitions\u002F253.html",[4357],"CWE-253"," , Incorrect Check of Function Return Value",[84,6269,6252],{},[69,6271,6272,6277,6285],{},[84,6273,6274],{},[43,6275,6241],{"href":6239,"rel":6276},[4357],[84,6278,6279,6284],{},[43,6280,6283],{"href":6281,"rel":6282},"http:\u002F\u002Fcwe.mitre.org\u002Fdata\u002Fdefinitions\u002F391.html",[4357],"CWE-391"," , Unchecked Error Condition",[84,6286,6287],{},"2017-07-06: CERT: Rule subset of CWE",[2702,6289,6291],{"id":6290},"cert-cwe-mapping-notes","CERT-CWE Mapping Notes",[39,6293,6294,6297],{},[43,6295,6089],{"href":6296},"\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fhow-this-coding-standard-is-organized#HowthisCodingStandardisOrganized-CERT-CWEMappingNotes"," for mapping notes",[5531,6299,6301],{"id":6300},"cwe-252cwe-253cwe-391-and-err33-cpos34-c","CWE-252\u002FCWE-253\u002FCWE-391 and ERR33-C\u002FPOS34-C",[39,6303,6304],{},"Independent( ERR33-C, POS54-C, FLP32-C, ERR34-C) Intersection( CWE-252, CWE-253) = Ø CWE-391 = Union( CWE-252, CWE-253) CWE-391 = Union( ERR33-C, POS34-C, list) where list =",[5129,6306,6307],{},[5132,6308,6309],{},"Ignoring return values of functions outside the C or POSIX standard libraries",[2702,6311,6313],{"id":6312},"bibliography","Bibliography",[63,6315,6317],{"className":6316},[5538],[79,6318,6319,6336,6348,6363],{},[69,6320,6322,6330],{"className":6321},[5568],[84,6323,6324,6325,6329],{},"[ ",[43,6326,6328],{"href":6327},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Faa-bibliography#AA.Bibliography-DHS06","DHS 2006"," ]",[84,6331,6332],{},[43,6333,6335],{"href":6334},"http:\u002F\u002Fbuildsecurityin.us-cert.gov\u002Fbsi\u002Farticles\u002Fknowledge\u002Fguidelines\u002F338-BSI.html","Handle All Errors Safely",[69,6337,6339,6345],{"className":6338},[5598],[84,6340,6324,6341,6329],{},[43,6342,6344],{"href":6343},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Faa-bibliography#AA.Bibliography-Henricson97","Henricson 1997",[84,6346,6347],{},"Recommendation 12.1, \"Check for All Errors Reported from Functions\"",[69,6349,6351,6356],{"className":6350},[5568],[84,6352,6324,6353,6329],{},[43,6354,2682],{"href":6355},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Faa-bibliography#AA.Bibliography-ISO-IEC9899-2014",[84,6357,6358,6359,6362],{},"Subclause 7.31.3.10, \"The ",[98,6360,6361],{},"      ungetc     "," Function\"",[69,6364,6366,6370],{"className":6365},[5598],[84,6367,6324,6368,6329],{},[43,6369,6055],{"href":6054},[84,6371,6372],{},[5589,6373],{},[6375,6376],"hr",{},[39,6378,6379,392,6386,392,6392],{},[43,6380,6382],{"href":6381},"\u002Fsei-cert-c-coding-standard\u002Frules\u002Ferror-handling-err\u002Ferr32-c",[6383,6384],"img",{"src":6385},"\u002Fattachments\u002F87152044\u002F88034188.png",[43,6387,6389],{"href":6388},"\u002Fsei-cert-c-coding-standard\u002Frules\u002Ferror-handling-err\u002F",[6383,6390],{"src":6391},"\u002Fattachments\u002F87152044\u002F88034190.png",[43,6393,6395],{"href":6394},"\u002Fsei-cert-c-coding-standard\u002Frules\u002Ferror-handling-err\u002Ferr34-c",[6383,6396],{"src":6397},"\u002Fattachments\u002F87152044\u002F88034189.png",[6399,6400,6401],"style",{},"html pre.shiki code .sC2Qs, html code.shiki .sC2Qs{--shiki-default:#D73A49;--shiki-dark:#F97583;--shiki-sepia:#F92672}html pre.shiki code .sstjo, html code.shiki .sstjo{--shiki-default:#032F62;--shiki-dark:#9ECBFF;--shiki-sepia:#E6DB74}html pre.shiki code .sMOD_, html code.shiki .sMOD_{--shiki-default:#24292E;--shiki-dark:#E1E4E8;--shiki-sepia:#F8F8F2}html pre.shiki code .sq6CD, html code.shiki .sq6CD{--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit;--shiki-sepia:#66D9EF;--shiki-sepia-font-style:italic}html pre.shiki code .srTi1, html code.shiki .srTi1{--shiki-default:#6F42C1;--shiki-dark:#B392F0;--shiki-sepia:#A6E22E}html pre.shiki code .s-m8C, html code.shiki .s-m8C{--shiki-default:#005CC5;--shiki-default-font-style:inherit;--shiki-dark:#79B8FF;--shiki-dark-font-style:inherit;--shiki-sepia:#66D9EF;--shiki-sepia-font-style:italic}html pre.shiki code .sTHNf, html code.shiki .sTHNf{--shiki-default:#E36209;--shiki-default-font-style:inherit;--shiki-dark:#FFAB70;--shiki-dark-font-style:inherit;--shiki-sepia:#FD971F;--shiki-sepia-font-style:italic}html pre.shiki code .s7F3e, html code.shiki .s7F3e{--shiki-default:#005CC5;--shiki-dark:#79B8FF;--shiki-sepia:#AE81FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}html.sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}html pre.shiki code .sOrwc, html code.shiki .sOrwc{--shiki-default:#E36209;--shiki-dark:#FFAB70;--shiki-sepia:#F8F8F2}html pre.shiki code .s8-w5, html code.shiki .s8-w5{--shiki-default:#6A737D;--shiki-dark:#6A737D;--shiki-sepia:#88846F}",{"title":2747,"searchDepth":2765,"depth":2765,"links":6403},[6404,6406,6408,6410,6412,6414,6416,6418,6420,6422,6424,6426,6427,6431,6432,6435],{"id":2704,"depth":2765,"text":6405},"Noncompliant Code Example ( setlocale() )",{"id":2930,"depth":2765,"text":6407},"Compliant Solution ( setlocale() )",{"id":3152,"depth":2765,"text":6409},"Noncompliant Code Example ( calloc() )",{"id":3540,"depth":2765,"text":6411},"Compliant Solution ( calloc() )",{"id":3836,"depth":2765,"text":6413},"Noncompliant Code Example ( realloc() )",{"id":3968,"depth":2765,"text":6415},"Compliant Solution ( realloc() )",{"id":4117,"depth":2765,"text":6417},"Noncompliant Code Example ( fseek() )",{"id":4225,"depth":2765,"text":6419},"Compliant Solution ( fseek() )",{"id":4344,"depth":2765,"text":6421},"Noncompliant Code Example ( snprintf() )",{"id":4500,"depth":2765,"text":6423},"Compliant Solution ( snprintf() )",{"id":4689,"depth":2765,"text":6425},"Compliant Solution ( snprintf( null ) )",{"id":5120,"depth":2765,"text":5121},{"id":5456,"depth":2765,"text":5457,"children":6428},[6429,6430],{"id":5533,"depth":2773,"text":5534},{"id":6045,"depth":2773,"text":6046},{"id":6082,"depth":2765,"text":6083},{"id":6290,"depth":2765,"text":6291,"children":6433},[6434],{"id":6300,"depth":2773,"text":6301},{"id":6312,"depth":2765,"text":6313},"The majority of the standard library functions, including I\u002FO functions and memory allocation functions, return either a valid value or a value of the correct return type that indicates an error (for example, −1 or a null pointer). Assuming that all calls to such functions will succeed and failing to check the return value for an indication of an error is a dangerous practice that may lead to unexpected or undefined behavior when an error occurs. It is essential that programs detect and appropriately handle all errors in accordance with an error-handling policy.","md",{"tags":6439},[6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450],"in-cpp","cwe-253","nptc","nptc-complexity","nptc-intent","err","cwe-391","cwe-390","rule","android-applicable","cwe-252","\u002Fsei-cert-c-coding-standard\u002Frules\u002Ferror-handling-err\u002Ferr33-c",{"title":30,"description":6436},"4.sei-cert-c-coding-standard\u002F03.rules\u002F08.error-handling-err\u002F4.err33-c","WONKYGbZcr4kAp9symR710pNiaxBrPgVUkQN4TrrJjw",[6456,6459],{"title":6457,"path":6381,"stem":6458,"children":-1},"ERR32-C. Do not rely on indeterminate values of errno","4.sei-cert-c-coding-standard\u002F03.rules\u002F08.error-handling-err\u002F3.err32-c",{"title":6460,"path":6394,"stem":6461,"children":-1},"ERR34-C. Detect errors when converting a string to a number","4.sei-cert-c-coding-standard\u002F03.rules\u002F08.error-handling-err\u002F5.err34-c",[6463],{"title":6464,"path":6465,"stem":6466,"children":6467},"SEI CERT C Coding Standard","\u002Fsei-cert-c-coding-standard","4.sei-cert-c-coding-standard\u002F01.index",[6468,6469,6541,7121,7393,7407,7411,7415,7419,8227],{"title":6464,"path":6465,"stem":6466},{"title":6470,"path":6471,"stem":6472,"children":6473},"Front Matter","\u002Fsei-cert-c-coding-standard\u002Ffront-matter","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F1.index",[6474,6475],{"title":6470,"path":6471,"stem":6472},{"title":6476,"path":6477,"stem":6478,"children":6479},"Introduction","\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F2.introduction\u002F01.index",[6480,6481,6485,6489,6493,6497,6501,6505,6509,6513,6517,6521,6525,6529,6533,6537],{"title":6476,"path":6477,"stem":6478},{"title":6482,"path":6483,"stem":6484},"Scope","\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fscope","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F2.introduction\u002F01.scope",{"title":6486,"path":6487,"stem":6488},"Audience","\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Faudience","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F2.introduction\u002F02.audience",{"title":6490,"path":6491,"stem":6492},"How this Coding Standard is Organized","\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fhow-this-coding-standard-is-organized","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F2.introduction\u002F03.how-this-coding-standard-is-organized",{"title":6494,"path":6495,"stem":6496},"History","\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fhistory","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F2.introduction\u002F04.history",{"title":6498,"path":6499,"stem":6500},"ISO\u002FIEC TS 17961 C Secure Coding Rules","\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fisoiec-ts-17961-c-secure-coding-rules","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F2.introduction\u002F05.isoiec-ts-17961-c-secure-coding-rules",{"title":6502,"path":6503,"stem":6504},"Tool Selection and Validation","\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Ftool-selection-and-validation","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F2.introduction\u002F06.tool-selection-and-validation",{"title":6506,"path":6507,"stem":6508},"Taint Analysis","\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Ftaint-analysis","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F2.introduction\u002F07.taint-analysis",{"title":6510,"path":6511,"stem":6512},"Rules versus Recommendations","\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Frules-versus-recommendations","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F2.introduction\u002F08.rules-versus-recommendations",{"title":6514,"path":6515,"stem":6516},"Conformance Testing","\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fconformance-testing","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F2.introduction\u002F09.conformance-testing",{"title":6518,"path":6519,"stem":6520},"Development Process","\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fdevelopment-process","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F2.introduction\u002F10.development-process",{"title":6522,"path":6523,"stem":6524},"Usage","\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fusage","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F2.introduction\u002F11.usage",{"title":6526,"path":6527,"stem":6528},"System Qualities","\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fsystem-qualities","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F2.introduction\u002F12.system-qualities",{"title":6530,"path":6531,"stem":6532},"Automatically Generated Code","\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fautomatically-generated-code","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F2.introduction\u002F13.automatically-generated-code",{"title":6534,"path":6535,"stem":6536},"Government Regulations","\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fgovernment-regulations","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F2.introduction\u002F14.government-regulations",{"title":6538,"path":6539,"stem":6540},"Acknowledgments","\u002Fsei-cert-c-coding-standard\u002Ffront-matter\u002Fintroduction\u002Facknowledgments","4.sei-cert-c-coding-standard\u002F02.front-matter\u002F2.introduction\u002F15.acknowledgments",{"title":6542,"path":6543,"stem":6544,"children":6545},"Rules","\u002Fsei-cert-c-coding-standard\u002Frules","4.sei-cert-c-coding-standard\u002F03.rules\u002F01.index",[6546,6547,6551,6581,6611,6673,6711,6737,6750,6815,6841,6899,6933,6963,6973,7011,7081,7099],{"title":6542,"path":6543,"stem":6544},{"title":6548,"path":6549,"stem":6550},"Application Programming Interfaces (API)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fapplication-programming-interfaces-api","4.sei-cert-c-coding-standard\u002F03.rules\u002F02.application-programming-interfaces-api",{"title":6552,"path":6553,"stem":6554,"children":6555},"Arrays (ARR)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Farrays-arr","4.sei-cert-c-coding-standard\u002F03.rules\u002F03.arrays-arr\u002F1.index",[6556,6557,6561,6565,6569,6573,6577],{"title":6552,"path":6553,"stem":6554},{"title":6558,"path":6559,"stem":6560},"ARR30-C. Do not form or use out-of-bounds pointers or array subscripts","\u002Fsei-cert-c-coding-standard\u002Frules\u002Farrays-arr\u002Farr30-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F03.arrays-arr\u002F2.arr30-c",{"title":6562,"path":6563,"stem":6564},"ARR32-C. Ensure size arguments for variable length arrays are in a valid range","\u002Fsei-cert-c-coding-standard\u002Frules\u002Farrays-arr\u002Farr32-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F03.arrays-arr\u002F3.arr32-c",{"title":6566,"path":6567,"stem":6568},"ARR36-C. Do not subtract or compare two pointers that do not refer to the same array","\u002Fsei-cert-c-coding-standard\u002Frules\u002Farrays-arr\u002Farr36-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F03.arrays-arr\u002F4.arr36-c",{"title":6570,"path":6571,"stem":6572},"ARR37-C. Do not add or subtract an integer to a pointer to a non-array object","\u002Fsei-cert-c-coding-standard\u002Frules\u002Farrays-arr\u002Farr37-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F03.arrays-arr\u002F5.arr37-c",{"title":6574,"path":6575,"stem":6576},"ARR38-C. Guarantee that library functions do not form invalid pointers","\u002Fsei-cert-c-coding-standard\u002Frules\u002Farrays-arr\u002Farr38-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F03.arrays-arr\u002F6.arr38-c",{"title":6578,"path":6579,"stem":6580},"ARR39-C. Do not add or subtract a scaled integer to a pointer","\u002Fsei-cert-c-coding-standard\u002Frules\u002Farrays-arr\u002Farr39-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F03.arrays-arr\u002F7.arr39-c",{"title":6582,"path":6583,"stem":6584,"children":6585},"Characters and Strings (STR)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fcharacters-and-strings-str","4.sei-cert-c-coding-standard\u002F03.rules\u002F04.characters-and-strings-str\u002F1.index",[6586,6587,6591,6595,6599,6603,6607],{"title":6582,"path":6583,"stem":6584},{"title":6588,"path":6589,"stem":6590},"STR30-C. Do not attempt to modify string literals","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fcharacters-and-strings-str\u002Fstr30-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F04.characters-and-strings-str\u002F2.str30-c",{"title":6592,"path":6593,"stem":6594},"STR31-C. Guarantee that storage for strings has sufficient space for character data and the null terminator","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fcharacters-and-strings-str\u002Fstr31-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F04.characters-and-strings-str\u002F3.str31-c",{"title":6596,"path":6597,"stem":6598},"STR32-C. Do not pass a non-null-terminated character sequence to a library function that expects a string","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fcharacters-and-strings-str\u002Fstr32-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F04.characters-and-strings-str\u002F4.str32-c",{"title":6600,"path":6601,"stem":6602},"STR34-C. Cast characters to unsigned char before converting to larger integer sizes","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fcharacters-and-strings-str\u002Fstr34-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F04.characters-and-strings-str\u002F5.str34-c",{"title":6604,"path":6605,"stem":6606},"STR37-C. Arguments to character-handling functions must be representable as an unsigned char","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fcharacters-and-strings-str\u002Fstr37-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F04.characters-and-strings-str\u002F6.str37-c",{"title":6608,"path":6609,"stem":6610},"STR38-C. Do not confuse narrow and wide character strings and functions","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fcharacters-and-strings-str\u002Fstr38-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F04.characters-and-strings-str\u002F7.str38-c",{"title":6612,"path":6613,"stem":6614,"children":6615},"Concurrency (CON)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fconcurrency-con","4.sei-cert-c-coding-standard\u002F03.rules\u002F05.concurrency-con\u002F01.index",[6616,6617,6621,6625,6629,6633,6637,6641,6645,6649,6653,6657,6661,6665,6669],{"title":6612,"path":6613,"stem":6614},{"title":6618,"path":6619,"stem":6620},"CON30-C. Clean up thread-specific storage","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon30-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F05.concurrency-con\u002F02.con30-c",{"title":6622,"path":6623,"stem":6624},"CON31-C. Do not destroy a mutex while it is locked","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon31-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F05.concurrency-con\u002F03.con31-c",{"title":6626,"path":6627,"stem":6628},"CON32-C. Prevent data races when accessing bit-fields from multiple threads","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon32-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F05.concurrency-con\u002F04.con32-c",{"title":6630,"path":6631,"stem":6632},"CON33-C. Avoid race conditions when using library functions","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon33-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F05.concurrency-con\u002F05.con33-c",{"title":6634,"path":6635,"stem":6636},"CON34-C. Declare objects shared between threads with appropriate storage durations","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon34-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F05.concurrency-con\u002F06.con34-c",{"title":6638,"path":6639,"stem":6640},"CON35-C. Avoid deadlock by locking in a predefined order","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon35-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F05.concurrency-con\u002F07.con35-c",{"title":6642,"path":6643,"stem":6644},"CON36-C. Wrap functions that can spuriously wake up in a loop","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon36-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F05.concurrency-con\u002F08.con36-c",{"title":6646,"path":6647,"stem":6648},"CON37-C. Do not call signal() in a multithreaded program","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon37-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F05.concurrency-con\u002F09.con37-c",{"title":6650,"path":6651,"stem":6652},"CON38-C. Preserve thread safety and liveness when using condition variables","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon38-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F05.concurrency-con\u002F10.con38-c",{"title":6654,"path":6655,"stem":6656},"CON39-C. Do not join or detach a thread that was previously joined or detached","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon39-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F05.concurrency-con\u002F11.con39-c",{"title":6658,"path":6659,"stem":6660},"CON40-C. Do not refer to an atomic variable twice in an expression","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon40-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F05.concurrency-con\u002F12.con40-c",{"title":6662,"path":6663,"stem":6664},"CON41-C. Wrap functions that can fail spuriously in a loop","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon41-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F05.concurrency-con\u002F13.con41-c",{"title":6666,"path":6667,"stem":6668},"CON42-C. Don't allow attackers to influence environment variables that control concurrency parameters","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon42-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F05.concurrency-con\u002F14.con42-c",{"title":6670,"path":6671,"stem":6672},"CON43-C. Do not allow data races in multithreaded code","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon43-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F05.concurrency-con\u002F15.con43-c",{"title":6674,"path":6675,"stem":6676,"children":6677},"Declarations and Initialization (DCL)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl","4.sei-cert-c-coding-standard\u002F03.rules\u002F06.declarations-and-initialization-dcl\u002F1.index",[6678,6679,6683,6687,6691,6695,6699,6703,6707],{"title":6674,"path":6675,"stem":6676},{"title":6680,"path":6681,"stem":6682},"DCL30-C. Declare objects with appropriate storage durations","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl30-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F06.declarations-and-initialization-dcl\u002F2.dcl30-c",{"title":6684,"path":6685,"stem":6686},"DCL31-C. Declare identifiers before using them","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl31-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F06.declarations-and-initialization-dcl\u002F3.dcl31-c",{"title":6688,"path":6689,"stem":6690},"DCL36-C. Do not declare an identifier with conflicting linkage classifications","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl36-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F06.declarations-and-initialization-dcl\u002F4.dcl36-c",{"title":6692,"path":6693,"stem":6694},"DCL37-C. Do not declare or define a reserved identifier","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl37-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F06.declarations-and-initialization-dcl\u002F5.dcl37-c",{"title":6696,"path":6697,"stem":6698},"DCL38-C. Use the correct syntax when declaring a flexible array member","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl38-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F06.declarations-and-initialization-dcl\u002F6.dcl38-c",{"title":6700,"path":6701,"stem":6702},"DCL39-C. Avoid information leakage when passing a structure across a trust boundary","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl39-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F06.declarations-and-initialization-dcl\u002F7.dcl39-c",{"title":6704,"path":6705,"stem":6706},"DCL40-C. Do not create incompatible declarations of the same function or object","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl40-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F06.declarations-and-initialization-dcl\u002F8.dcl40-c",{"title":6708,"path":6709,"stem":6710},"DCL41-C. Do not declare variables inside a switch statement before the first case label","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl41-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F06.declarations-and-initialization-dcl\u002F9.dcl41-c",{"title":6712,"path":6713,"stem":6714,"children":6715},"Environment (ENV)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fenvironment-env","4.sei-cert-c-coding-standard\u002F03.rules\u002F07.environment-env\u002F1.index",[6716,6717,6721,6725,6729,6733],{"title":6712,"path":6713,"stem":6714},{"title":6718,"path":6719,"stem":6720},"ENV30-C. Do not modify the object referenced by the return value of certain functions","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fenvironment-env\u002Fenv30-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F07.environment-env\u002F2.env30-c",{"title":6722,"path":6723,"stem":6724},"ENV31-C. Do not rely on an environment pointer following an operation that may invalidate it","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fenvironment-env\u002Fenv31-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F07.environment-env\u002F3.env31-c",{"title":6726,"path":6727,"stem":6728},"ENV32-C. All exit handlers must return normally","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fenvironment-env\u002Fenv32-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F07.environment-env\u002F4.env32-c",{"title":6730,"path":6731,"stem":6732},"ENV33-C. Do not call system()","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fenvironment-env\u002Fenv33-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F07.environment-env\u002F5.env33-c",{"title":6734,"path":6735,"stem":6736},"ENV34-C. Do not store pointers returned by certain functions","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fenvironment-env\u002Fenv34-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F07.environment-env\u002F6.env34-c",{"title":6738,"path":6739,"stem":6740,"children":6741},"Error Handling (ERR)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Ferror-handling-err","4.sei-cert-c-coding-standard\u002F03.rules\u002F08.error-handling-err\u002F1.index",[6742,6743,6747,6748,6749],{"title":6738,"path":6739,"stem":6740},{"title":6744,"path":6745,"stem":6746},"ERR30-C. Take care when reading errno","\u002Fsei-cert-c-coding-standard\u002Frules\u002Ferror-handling-err\u002Ferr30-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F08.error-handling-err\u002F2.err30-c",{"title":6457,"path":6381,"stem":6458},{"title":30,"path":6451,"stem":6453},{"title":6460,"path":6394,"stem":6461},{"title":6751,"path":6752,"stem":6753,"children":6754},"Expressions (EXP)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fexpressions-exp","4.sei-cert-c-coding-standard\u002F03.rules\u002F09.expressions-exp\u002F01.index",[6755,6756,6760,6764,6768,6771,6775,6779,6783,6787,6791,6795,6799,6803,6807,6811],{"title":6751,"path":6752,"stem":6753},{"title":6757,"path":6758,"stem":6759},"EXP30-C. Do not depend on the order of evaluation for side effects","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp30-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F09.expressions-exp\u002F02.exp30-c",{"title":6761,"path":6762,"stem":6763},"EXP32-C. Do not access a volatile object through a nonvolatile reference","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp32-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F09.expressions-exp\u002F03.exp32-c",{"title":6765,"path":6766,"stem":6767},"EXP33-C. Do not read uninitialized memory","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp33-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F09.expressions-exp\u002F04.exp33-c",{"title":6769,"path":6142,"stem":6770},"EXP34-C. Do not dereference null pointers","4.sei-cert-c-coding-standard\u002F03.rules\u002F09.expressions-exp\u002F05.exp34-c",{"title":6772,"path":6773,"stem":6774},"EXP35-C. Do not modify objects with temporary lifetime","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp35-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F09.expressions-exp\u002F06.exp35-c",{"title":6776,"path":6777,"stem":6778},"EXP36-C. Do not cast pointers into more strictly aligned pointer types","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp36-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F09.expressions-exp\u002F07.exp36-c",{"title":6780,"path":6781,"stem":6782},"EXP37-C. Call functions with the correct number and type of arguments","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp37-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F09.expressions-exp\u002F08.exp37-c",{"title":6784,"path":6785,"stem":6786},"EXP39-C. Do not access a variable through a pointer of an incompatible type","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp39-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F09.expressions-exp\u002F09.exp39-c",{"title":6788,"path":6789,"stem":6790},"EXP40-C. Do not modify constant objects","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp40-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F09.expressions-exp\u002F10.exp40-c",{"title":6792,"path":6793,"stem":6794},"EXP42-C. Do not compare padding data","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp42-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F09.expressions-exp\u002F11.exp42-c",{"title":6796,"path":6797,"stem":6798},"EXP43-C. Avoid undefined behavior when using restrict-qualified pointers","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp43-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F09.expressions-exp\u002F12.exp43-c",{"title":6800,"path":6801,"stem":6802},"EXP44-C. Do not rely on side effects in operands to sizeof, _Alignof, or _Generic","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp44-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F09.expressions-exp\u002F13.exp44-c",{"title":6804,"path":6805,"stem":6806},"EXP45-C. Do not perform assignments in selection statements","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp45-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F09.expressions-exp\u002F14.exp45-c",{"title":6808,"path":6809,"stem":6810},"EXP46-C. Do not use a bitwise operator with a Boolean-like operand","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp46-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F09.expressions-exp\u002F15.exp46-c",{"title":6812,"path":6813,"stem":6814},"EXP47-C. Do not call va_arg with an argument of the incorrect type","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp47-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F09.expressions-exp\u002F16.exp47-c",{"title":6816,"path":6817,"stem":6818,"children":6819},"Floating Point (FLP)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Ffloating-point-flp","4.sei-cert-c-coding-standard\u002F03.rules\u002F10.floating-point-flp\u002F1.index",[6820,6821,6825,6829,6833,6837],{"title":6816,"path":6817,"stem":6818},{"title":6822,"path":6823,"stem":6824},"FLP30-C. Do not use floating-point variables as loop counters","\u002Fsei-cert-c-coding-standard\u002Frules\u002Ffloating-point-flp\u002Fflp30-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F10.floating-point-flp\u002F2.flp30-c",{"title":6826,"path":6827,"stem":6828},"FLP32-C. Prevent or detect domain and range errors in math functions","\u002Fsei-cert-c-coding-standard\u002Frules\u002Ffloating-point-flp\u002Fflp32-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F10.floating-point-flp\u002F3.flp32-c",{"title":6830,"path":6831,"stem":6832},"FLP34-C. Ensure that floating-point conversions are within range of the new type","\u002Fsei-cert-c-coding-standard\u002Frules\u002Ffloating-point-flp\u002Fflp34-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F10.floating-point-flp\u002F4.flp34-c",{"title":6834,"path":6835,"stem":6836},"FLP36-C. Preserve precision when converting integral values to floating-point type","\u002Fsei-cert-c-coding-standard\u002Frules\u002Ffloating-point-flp\u002Fflp36-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F10.floating-point-flp\u002F5.flp36-c",{"title":6838,"path":6839,"stem":6840},"FLP37-C. Do not use object representations to compare floating-point values","\u002Fsei-cert-c-coding-standard\u002Frules\u002Ffloating-point-flp\u002Fflp37-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F10.floating-point-flp\u002F6.flp37-c",{"title":6842,"path":6843,"stem":6844,"children":6845},"Input Output (FIO)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Finput-output-fio","4.sei-cert-c-coding-standard\u002F03.rules\u002F11.input-output-fio\u002F01.index",[6846,6847,6851,6855,6859,6863,6867,6871,6875,6879,6883,6887,6891,6895],{"title":6842,"path":6843,"stem":6844},{"title":6848,"path":6849,"stem":6850},"FIO30-C. Exclude user input from format strings","\u002Fsei-cert-c-coding-standard\u002Frules\u002Finput-output-fio\u002Ffio30-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F11.input-output-fio\u002F02.fio30-c",{"title":6852,"path":6853,"stem":6854},"FIO32-C. Do not perform operations on devices that are only appropriate for files","\u002Fsei-cert-c-coding-standard\u002Frules\u002Finput-output-fio\u002Ffio32-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F11.input-output-fio\u002F03.fio32-c",{"title":6856,"path":6857,"stem":6858},"FIO34-C. Distinguish between characters read from a file and EOF or WEOF","\u002Fsei-cert-c-coding-standard\u002Frules\u002Finput-output-fio\u002Ffio34-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F11.input-output-fio\u002F04.fio34-c",{"title":6860,"path":6861,"stem":6862},"FIO37-C. Do not assume that fgets() or fgetws() returns a nonempty string when successful","\u002Fsei-cert-c-coding-standard\u002Frules\u002Finput-output-fio\u002Ffio37-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F11.input-output-fio\u002F05.fio37-c",{"title":6864,"path":6865,"stem":6866},"FIO38-C. Do not copy a FILE object","\u002Fsei-cert-c-coding-standard\u002Frules\u002Finput-output-fio\u002Ffio38-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F11.input-output-fio\u002F06.fio38-c",{"title":6868,"path":6869,"stem":6870},"FIO39-C. Do not alternately input and output from a stream without an intervening flush or positioning call","\u002Fsei-cert-c-coding-standard\u002Frules\u002Finput-output-fio\u002Ffio39-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F11.input-output-fio\u002F07.fio39-c",{"title":6872,"path":6873,"stem":6874},"FIO40-C. Reset strings on fgets() or fgetws() failure","\u002Fsei-cert-c-coding-standard\u002Frules\u002Finput-output-fio\u002Ffio40-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F11.input-output-fio\u002F08.fio40-c",{"title":6876,"path":6877,"stem":6878},"FIO41-C. Do not call getc(), putc(), getwc(), or putwc() with a stream argument that has side effects","\u002Fsei-cert-c-coding-standard\u002Frules\u002Finput-output-fio\u002Ffio41-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F11.input-output-fio\u002F09.fio41-c",{"title":6880,"path":6881,"stem":6882},"FIO42-C. Close files when they are no longer needed","\u002Fsei-cert-c-coding-standard\u002Frules\u002Finput-output-fio\u002Ffio42-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F11.input-output-fio\u002F10.fio42-c",{"title":6884,"path":6885,"stem":6886},"FIO44-C. Only use values for fsetpos() that are returned from fgetpos()","\u002Fsei-cert-c-coding-standard\u002Frules\u002Finput-output-fio\u002Ffio44-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F11.input-output-fio\u002F11.fio44-c",{"title":6888,"path":6889,"stem":6890},"FIO45-C. Avoid TOCTOU race conditions while accessing files","\u002Fsei-cert-c-coding-standard\u002Frules\u002Finput-output-fio\u002Ffio45-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F11.input-output-fio\u002F12.fio45-c",{"title":6892,"path":6893,"stem":6894},"FIO46-C. Do not access a closed file","\u002Fsei-cert-c-coding-standard\u002Frules\u002Finput-output-fio\u002Ffio46-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F11.input-output-fio\u002F13.fio46-c",{"title":6896,"path":6897,"stem":6898},"FIO47-C. Use valid format strings","\u002Fsei-cert-c-coding-standard\u002Frules\u002Finput-output-fio\u002Ffio47-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F11.input-output-fio\u002F14.fio47-c",{"title":6900,"path":6901,"stem":6902,"children":6903},"Integers (INT)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fintegers-int","4.sei-cert-c-coding-standard\u002F03.rules\u002F12.integers-int\u002F1.index",[6904,6905,6909,6913,6917,6921,6925,6929],{"title":6900,"path":6901,"stem":6902},{"title":6906,"path":6907,"stem":6908},"INT30-C. Ensure that unsigned integer operations do not wrap","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fintegers-int\u002Fint30-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F12.integers-int\u002F2.int30-c",{"title":6910,"path":6911,"stem":6912},"INT31-C. Ensure that integer conversions do not result in lost or misinterpreted data","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fintegers-int\u002Fint31-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F12.integers-int\u002F3.int31-c",{"title":6914,"path":6915,"stem":6916},"INT32-C. Ensure that operations on signed integers do not result in overflow","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fintegers-int\u002Fint32-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F12.integers-int\u002F4.int32-c",{"title":6918,"path":6919,"stem":6920},"INT33-C. Ensure that division and remainder operations do not result in divide-by-zero errors","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fintegers-int\u002Fint33-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F12.integers-int\u002F5.int33-c",{"title":6922,"path":6923,"stem":6924},"INT34-C. Do not shift an expression by a negative number of bits or by greater than or equal to the number of bits that exist in the operand","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fintegers-int\u002Fint34-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F12.integers-int\u002F6.int34-c",{"title":6926,"path":6927,"stem":6928},"INT35-C. Use correct integer precisions","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fintegers-int\u002Fint35-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F12.integers-int\u002F7.int35-c",{"title":6930,"path":6931,"stem":6932},"INT36-C. Converting a pointer to integer or integer to pointer","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fintegers-int\u002Fint36-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F12.integers-int\u002F8.int36-c",{"title":6934,"path":6935,"stem":6936,"children":6937},"Memory Management (MEM)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmemory-management-mem","4.sei-cert-c-coding-standard\u002F03.rules\u002F13.memory-management-mem\u002F1.index",[6938,6939,6943,6947,6951,6955,6959],{"title":6934,"path":6935,"stem":6936},{"title":6940,"path":6941,"stem":6942},"MEM30-C. Do not access freed memory","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmemory-management-mem\u002Fmem30-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F13.memory-management-mem\u002F2.mem30-c",{"title":6944,"path":6945,"stem":6946},"MEM31-C. Free dynamically allocated memory when no longer needed","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmemory-management-mem\u002Fmem31-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F13.memory-management-mem\u002F3.mem31-c",{"title":6948,"path":6949,"stem":6950},"MEM33-C. Allocate and copy structures containing a flexible array member dynamically","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmemory-management-mem\u002Fmem33-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F13.memory-management-mem\u002F4.mem33-c",{"title":6952,"path":6953,"stem":6954},"MEM34-C. Only free memory allocated dynamically","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmemory-management-mem\u002Fmem34-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F13.memory-management-mem\u002F5.mem34-c",{"title":6956,"path":6957,"stem":6958},"MEM35-C. Allocate sufficient memory for an object","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmemory-management-mem\u002Fmem35-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F13.memory-management-mem\u002F6.mem35-c",{"title":6960,"path":6961,"stem":6962},"MEM36-C. Do not modify the alignment of objects by calling realloc()","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmemory-management-mem\u002Fmem36-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F13.memory-management-mem\u002F7.mem36-c",{"title":6964,"path":6965,"stem":6966,"children":6967},"Microsoft Windows (WIN)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmicrosoft-windows-win","4.sei-cert-c-coding-standard\u002F03.rules\u002F14.microsoft-windows-win\u002F1.index",[6968,6969],{"title":6964,"path":6965,"stem":6966},{"title":6970,"path":6971,"stem":6972},"WIN30-C. Properly pair allocation and deallocation functions","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmicrosoft-windows-win\u002Fwin30-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F14.microsoft-windows-win\u002F2.win30-c",{"title":6974,"path":6975,"stem":6976,"children":6977},"Miscellaneous (MSC)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmiscellaneous-msc","4.sei-cert-c-coding-standard\u002F03.rules\u002F15.miscellaneous-msc\u002F1.index",[6978,6979,6983,6987,6991,6995,6999,7003,7007],{"title":6974,"path":6975,"stem":6976},{"title":6980,"path":6981,"stem":6982},"MSC30-C. Do not use the rand() function for generating pseudorandom numbers","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmiscellaneous-msc\u002Fmsc30-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F15.miscellaneous-msc\u002F2.msc30-c",{"title":6984,"path":6985,"stem":6986},"MSC32-C. Properly seed pseudorandom number generators","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmiscellaneous-msc\u002Fmsc32-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F15.miscellaneous-msc\u002F3.msc32-c",{"title":6988,"path":6989,"stem":6990},"MSC33-C. Do not pass invalid data to the asctime() function","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmiscellaneous-msc\u002Fmsc33-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F15.miscellaneous-msc\u002F4.msc33-c",{"title":6992,"path":6993,"stem":6994},"MSC37-C. Ensure that control never reaches the end of a non-void function","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmiscellaneous-msc\u002Fmsc37-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F15.miscellaneous-msc\u002F5.msc37-c",{"title":6996,"path":6997,"stem":6998},"MSC38-C. Do not treat a predefined identifier as an object if it might only be implemented as a macro","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmiscellaneous-msc\u002Fmsc38-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F15.miscellaneous-msc\u002F6.msc38-c",{"title":7000,"path":7001,"stem":7002},"MSC39-C. Do not call va_arg() on a va_list that has an indeterminate value","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmiscellaneous-msc\u002Fmsc39-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F15.miscellaneous-msc\u002F7.msc39-c",{"title":7004,"path":7005,"stem":7006},"MSC40-C. Do not violate constraints","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmiscellaneous-msc\u002Fmsc40-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F15.miscellaneous-msc\u002F8.msc40-c",{"title":7008,"path":7009,"stem":7010},"MSC41-C. Never hard code sensitive information","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fmiscellaneous-msc\u002Fmsc41-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F15.miscellaneous-msc\u002F9.msc41-c",{"title":7012,"path":7013,"stem":7014,"children":7015},"POSIX (POS)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F01.index",[7016,7017,7021,7025,7029,7033,7037,7041,7045,7049,7053,7057,7061,7065,7069,7073,7077],{"title":7012,"path":7013,"stem":7014},{"title":7018,"path":7019,"stem":7020},"POS30-C. Use the readlink() function properly","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos\u002Fpos30-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F02.pos30-c",{"title":7022,"path":7023,"stem":7024},"POS34-C. Do not call putenv() with a pointer to an automatic variable as the argument","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos\u002Fpos34-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F03.pos34-c",{"title":7026,"path":7027,"stem":7028},"POS35-C. Avoid race conditions while checking for the existence of a symbolic link","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos\u002Fpos35-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F04.pos35-c",{"title":7030,"path":7031,"stem":7032},"POS36-C. Observe correct revocation order while relinquishing privileges","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos\u002Fpos36-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F05.pos36-c",{"title":7034,"path":7035,"stem":7036},"POS37-C. Ensure that privilege relinquishment is successful","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos\u002Fpos37-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F06.pos37-c",{"title":7038,"path":7039,"stem":7040},"POS38-C. Beware of race conditions when using fork and file descriptors","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos\u002Fpos38-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F07.pos38-c",{"title":7042,"path":7043,"stem":7044},"POS39-C. Use the correct byte ordering when transferring data between systems","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos\u002Fpos39-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F08.pos39-c",{"title":7046,"path":7047,"stem":7048},"POS44-C. Do not use signals to terminate threads","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos\u002Fpos44-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F09.pos44-c",{"title":7050,"path":7051,"stem":7052},"POS47-C. Do not use threads that can be canceled asynchronously","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos\u002Fpos47-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F10.pos47-c",{"title":7054,"path":7055,"stem":7056},"POS48-C. Do not unlock or destroy another POSIX thread's mutex","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos\u002Fpos48-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F11.pos48-c",{"title":7058,"path":7059,"stem":7060},"POS49-C. When data must be accessed by multiple threads, provide a mutex and guarantee no adjacent data is also accessed","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos\u002Fpos49-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F12.pos49-c",{"title":7062,"path":7063,"stem":7064},"POS50-C. Declare objects shared between POSIX threads with appropriate storage durations","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos\u002Fpos50-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F13.pos50-c",{"title":7066,"path":7067,"stem":7068},"POS51-C. Avoid deadlock with POSIX threads by locking in predefined order","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos\u002Fpos51-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F14.pos51-c",{"title":7070,"path":7071,"stem":7072},"POS52-C. Do not perform operations that can block while holding a POSIX lock","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos\u002Fpos52-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F15.pos52-c",{"title":7074,"path":7075,"stem":7076},"POS53-C. Do not use more than one mutex for concurrent waiting operations on a condition variable","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos\u002Fpos53-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F16.pos53-c",{"title":7078,"path":7079,"stem":7080},"POS54-C. Detect and handle POSIX library errors","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fposix-pos\u002Fpos54-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F16.posix-pos\u002F17.pos54-c",{"title":7082,"path":7083,"stem":7084,"children":7085},"Preprocessor (PRE)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fpreprocessor-pre","4.sei-cert-c-coding-standard\u002F03.rules\u002F17.preprocessor-pre\u002F1.index",[7086,7087,7091,7095],{"title":7082,"path":7083,"stem":7084},{"title":7088,"path":7089,"stem":7090},"PRE30-C. Do not create a universal character name through concatenation","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fpreprocessor-pre\u002Fpre30-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F17.preprocessor-pre\u002F2.pre30-c",{"title":7092,"path":7093,"stem":7094},"PRE31-C. Avoid side effects in arguments to unsafe macros","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fpreprocessor-pre\u002Fpre31-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F17.preprocessor-pre\u002F3.pre31-c",{"title":7096,"path":7097,"stem":7098},"PRE32-C. Do not use preprocessor directives in invocations of function-like macros","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fpreprocessor-pre\u002Fpre32-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F17.preprocessor-pre\u002F4.pre32-c",{"title":7100,"path":7101,"stem":7102,"children":7103},"Signals (SIG)","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fsignals-sig","4.sei-cert-c-coding-standard\u002F03.rules\u002F18.signals-sig\u002F1.index",[7104,7105,7109,7113,7117],{"title":7100,"path":7101,"stem":7102},{"title":7106,"path":7107,"stem":7108},"SIG30-C. Call only asynchronous-safe functions within signal handlers","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fsignals-sig\u002Fsig30-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F18.signals-sig\u002F2.sig30-c",{"title":7110,"path":7111,"stem":7112},"SIG31-C. Do not access shared objects in signal handlers","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fsignals-sig\u002Fsig31-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F18.signals-sig\u002F3.sig31-c",{"title":7114,"path":7115,"stem":7116},"SIG34-C. Do not call signal() from within interruptible signal handlers","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fsignals-sig\u002Fsig34-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F18.signals-sig\u002F4.sig34-c",{"title":7118,"path":7119,"stem":7120},"SIG35-C. Do not return from a computational exception signal handler","\u002Fsei-cert-c-coding-standard\u002Frules\u002Fsignals-sig\u002Fsig35-c","4.sei-cert-c-coding-standard\u002F03.rules\u002F18.signals-sig\u002F5.sig35-c",{"title":7122,"path":7123,"stem":7124,"children":7125},"Back Matter","\u002Fsei-cert-c-coding-standard\u002Fback-matter","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F1.index",[7126,7127,7131,7135,7139,7143,7332,7389],{"title":7122,"path":7123,"stem":7124},{"title":7128,"path":7129,"stem":7130},"AA. Bibliography","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Faa-bibliography","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F2.aa-bibliography",{"title":7132,"path":7133,"stem":7134},"BB. Definitions","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fbb-definitions","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F3.bb-definitions",{"title":7136,"path":7137,"stem":7138},"CC. Undefined Behavior","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fcc-undefined-behavior","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F4.cc-undefined-behavior",{"title":7140,"path":7141,"stem":7142},"DD. Unspecified Behavior","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fdd-unspecified-behavior","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F5.dd-unspecified-behavior",{"title":7144,"path":7145,"stem":7146,"children":7147},"EE. Analyzers","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F01.index",[7148,7149,7151,7155,7157,7161,7165,7169,7173,7177,7181,7185,7189,7191,7195,7197,7201,7205,7207,7211,7215,7219,7223,7227,7231,7235,7239,7241,7245,7247,7251,7254,7258,7261,7265,7267,7271,7273,7277,7281,7285,7288,7292,7296,7298,7302,7306,7310,7314,7318,7322,7326,7328],{"title":7144,"path":7145,"stem":7146},{"title":5574,"path":5573,"stem":7150},"4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F02.astree",{"title":7152,"path":7153,"stem":7154},"Astrée_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fastree_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F03.astree_v",{"title":5604,"path":5603,"stem":7156},"4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F04.axivion-bauhaus-suite",{"title":7158,"path":7159,"stem":7160},"Axivion Bauhaus Suite_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Faxivion-bauhaus-suite_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F05.axivion-bauhaus-suite_v",{"title":7162,"path":7163,"stem":7164},"Clang","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fclang","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F06.clang",{"title":7166,"path":7167,"stem":7168},"Clang_38_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fclang_38_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F07.clang_38_v",{"title":7170,"path":7171,"stem":7172},"Clang_39_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fclang_39_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F08.clang_39_v",{"title":7174,"path":7175,"stem":7176},"Clang_40_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fclang_40_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F09.clang_40_v",{"title":7178,"path":7179,"stem":7180},"Clang_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fclang_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F10.clang_v",{"title":7182,"path":7183,"stem":7184},"Codee","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fcodee","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F11.codee",{"title":7186,"path":7187,"stem":7188},"Codee_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fcodee_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F12.codee_v",{"title":5630,"path":5629,"stem":7190},"4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F13.codesonar",{"title":7192,"path":7193,"stem":7194},"CodeSonar_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fcodesonar_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F14.codesonar_v",{"title":5702,"path":5701,"stem":7196},"4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F15.coverity",{"title":7198,"path":7199,"stem":7200},"Coverity_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fcoverity_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F16.coverity_v",{"title":7202,"path":7203,"stem":7204},"Cppcheck","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fcppcheck","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F17.cppcheck",{"title":5743,"path":5742,"stem":7206},"4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F18.cppcheck-premium",{"title":7208,"path":7209,"stem":7210},"Cppcheck Premium_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fcppcheck-premium_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F19.cppcheck-premium_v",{"title":7212,"path":7213,"stem":7214},"Cppcheck_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fcppcheck_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F20.cppcheck_v",{"title":7216,"path":7217,"stem":7218},"ECLAIR","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Feclair","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F21.eclair",{"title":7220,"path":7221,"stem":7222},"ECLAIR_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Feclair_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F22.eclair_v",{"title":7224,"path":7225,"stem":7226},"EDG","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fedg","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F23.edg",{"title":7228,"path":7229,"stem":7230},"EDG_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fedg_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F24.edg_v",{"title":7232,"path":7233,"stem":7234},"GCC","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fgcc","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F25.gcc",{"title":7236,"path":7237,"stem":7238},"GCC_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fgcc_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F26.gcc_v",{"title":5769,"path":5768,"stem":7240},"4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F27.helix-qac",{"title":7242,"path":7243,"stem":7244},"Helix QAC_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fhelix-qac_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F28.helix-qac_v",{"title":5807,"path":5806,"stem":7246},"4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F29.klocwork",{"title":7248,"path":7249,"stem":7250},"Klocwork_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fklocwork_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F30.klocwork_v",{"title":7252,"path":5841,"stem":7253},"LDRA","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F31.ldra",{"title":7255,"path":7256,"stem":7257},"LDRA_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fldra_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F32.ldra_v",{"title":7259,"path":5866,"stem":7260},"Parasoft","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F33.parasoft",{"title":7262,"path":7263,"stem":7264},"Parasoft_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fparasoft_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F34.parasoft_v",{"title":5925,"path":5924,"stem":7266},"4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F35.pc-lint-plus",{"title":7268,"path":7269,"stem":7270},"PC-lint Plus_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fpc-lint-plus_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F36.pc-lint-plus_v",{"title":5956,"path":5955,"stem":7272},"4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F37.polyspace-bug-finder",{"title":7274,"path":7275,"stem":7276},"Polyspace Bug Finder_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fpolyspace-bug-finder_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F38.polyspace-bug-finder_v",{"title":7278,"path":7279,"stem":7280},"PVS-Studio","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fpvs-studio","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F39.pvs-studio",{"title":7282,"path":7283,"stem":7284},"PVS-Studio_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fpvs-studio_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F40.pvs-studio_v",{"title":7286,"path":5668,"stem":7287},"Rose","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F41.rose",{"title":7289,"path":7290,"stem":7291},"Rose_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Frose_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F42.rose_v",{"title":7293,"path":7294,"stem":7295},"Rosecheckers Code","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Frosecheckers-code","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F43.rosecheckers-code",{"title":6004,"path":6003,"stem":7297},"4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F44.rulechecker",{"title":7299,"path":7300,"stem":7301},"RuleChecker_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Frulechecker_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F45.rulechecker_v",{"title":7303,"path":7304,"stem":7305},"Security Reviewer - Static Reviewer","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fsecurity-reviewer-static-reviewer","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F46.security-reviewer-static-reviewer",{"title":7307,"path":7308,"stem":7309},"Security Reviewer - Static Reviewer_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fsecurity-reviewer-static-reviewer_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F47.security-reviewer-static-reviewer_v",{"title":7311,"path":7312,"stem":7313},"SonarQube C\u002FC++ Plugin","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fsonarqube-ccpp-plugin","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F48.sonarqube-ccpp-plugin",{"title":7315,"path":7316,"stem":7317},"SonarQube C\u002FC++ Plugin_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fsonarqube-ccpp-plugin_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F49.sonarqube-ccpp-plugin_v",{"title":7319,"path":7320,"stem":7321},"Splint","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fsplint","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F50.splint",{"title":7323,"path":7324,"stem":7325},"Splint_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Fsplint_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F51.splint_v",{"title":6026,"path":6025,"stem":7327},"4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F52.trustinsoft-analyzer",{"title":7329,"path":7330,"stem":7331},"TrustInSoft Analyzer_V","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fee-analyzers\u002Ftrustinsoft-analyzer_v","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F6.ee-analyzers\u002F53.trustinsoft-analyzer_v",{"title":7333,"path":7334,"stem":7335,"children":7336},"FF. Related Guidelines","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fff-related-guidelines","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F7.ff-related-guidelines\u002F01.index",[7337,7338,7342,7346,7350,7354,7358,7362,7366,7370,7373,7377,7381,7385],{"title":7333,"path":7334,"stem":7335},{"title":7339,"path":7340,"stem":7341},"2003","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fff-related-guidelines\u002F02.2003","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F7.ff-related-guidelines\u002F02.2003",{"title":7343,"path":7344,"stem":7345},"2006","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fff-related-guidelines\u002F03.2006","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F7.ff-related-guidelines\u002F03.2006",{"title":7347,"path":7348,"stem":7349},"2007","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fff-related-guidelines\u002F04.2007","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F7.ff-related-guidelines\u002F04.2007",{"title":7351,"path":7352,"stem":7353},"2008","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fff-related-guidelines\u002F05.2008","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F7.ff-related-guidelines\u002F05.2008",{"title":7355,"path":7356,"stem":7357},"2010","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fff-related-guidelines\u002F06.2010","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F7.ff-related-guidelines\u002F06.2010",{"title":7359,"path":7360,"stem":7361},"2011","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fff-related-guidelines\u002F07.2011","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F7.ff-related-guidelines\u002F07.2011",{"title":7363,"path":7364,"stem":7365},"2012","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fff-related-guidelines\u002F08.2012","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F7.ff-related-guidelines\u002F08.2012",{"title":7367,"path":7368,"stem":7369},"2013","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fff-related-guidelines\u002F09.2013","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F7.ff-related-guidelines\u002F09.2013",{"title":7367,"path":7371,"stem":7372},"\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fff-related-guidelines\u002F10.2013","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F7.ff-related-guidelines\u002F10.2013",{"title":7374,"path":7375,"stem":7376},"MITRE CWE","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fff-related-guidelines\u002Fmitre-cwe","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F7.ff-related-guidelines\u002F11.mitre-cwe",{"title":7378,"path":7379,"stem":7380},"MITRE CWE 2.11","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fff-related-guidelines\u002Fmitre-cwe-211","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F7.ff-related-guidelines\u002F12.mitre-cwe-211",{"title":7382,"path":7383,"stem":7384},"MITRE CWE 3.1","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fff-related-guidelines\u002Fmitre-cwe-31","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F7.ff-related-guidelines\u002F13.mitre-cwe-31",{"title":7386,"path":7387,"stem":7388},"MITRE CWE 3.11","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fff-related-guidelines\u002Fmitre-cwe-311","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F7.ff-related-guidelines\u002F14.mitre-cwe-311",{"title":7390,"path":7391,"stem":7392},"GG. Risk Assessments","\u002Fsei-cert-c-coding-standard\u002Fback-matter\u002Fgg-risk-assessments","4.sei-cert-c-coding-standard\u002F04.back-matter\u002F8.gg-risk-assessments",{"title":7394,"path":7395,"stem":7396,"children":7397},"Admin","\u002Fsei-cert-c-coding-standard\u002Fadmin","4.sei-cert-c-coding-standard\u002F05.admin\u002F1.index",[7398,7399,7403],{"title":7394,"path":7395,"stem":7396},{"title":7400,"path":7401,"stem":7402},"TODO List","\u002Fsei-cert-c-coding-standard\u002Fadmin\u002Ftodo-list","4.sei-cert-c-coding-standard\u002F05.admin\u002F2.todo-list",{"title":7404,"path":7405,"stem":7406},"Undefined and implementation-defined behaviors not deemed ruleworthy","\u002Fsei-cert-c-coding-standard\u002Fadmin\u002Fundefined-and-implementation-defined-behaviors-not-deemed-ruleworthy","4.sei-cert-c-coding-standard\u002F05.admin\u002F3.undefined-and-implementation-defined-behaviors-not-deemed-ruleworthy",{"title":7408,"path":7409,"stem":7410},"Coding Style Guidelines","\u002Fsei-cert-c-coding-standard\u002Fcoding-style-guidelines","4.sei-cert-c-coding-standard\u002F05.coding-style-guidelines",{"title":7412,"path":7413,"stem":7414},"Errata for SEI CERT C Coding Standard (2016 Edition)","\u002Fsei-cert-c-coding-standard\u002Ferrata-for-sei-cert-c-coding-standard-2016-edition","4.sei-cert-c-coding-standard\u002F06.errata-for-sei-cert-c-coding-standard-2016-edition",{"title":7416,"path":7417,"stem":7418},"Wiki Contents","\u002Fsei-cert-c-coding-standard\u002Fwiki-contents","4.sei-cert-c-coding-standard\u002F06.wiki-contents",{"title":7420,"path":7421,"stem":7422,"children":7423},"Recommendations","\u002Fsei-cert-c-coding-standard\u002Frecommendations","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F01.index",[7424,7425,7466,7483,7528,7569,7666,7683,7714,7781,7818,7902,7967,8014,8039,8132,8153,8210],{"title":7420,"path":7421,"stem":7422},{"title":6548,"path":7426,"stem":7427,"children":7428},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fapplication-programming-interfaces-api","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F02.application-programming-interfaces-api\u002F01.index",[7429,7430,7434,7438,7442,7446,7450,7454,7458,7462],{"title":6548,"path":7426,"stem":7427},{"title":7431,"path":7432,"stem":7433},"API00-C. Functions should validate their parameters","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fapplication-programming-interfaces-api\u002Fapi00-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F02.application-programming-interfaces-api\u002F02.api00-c",{"title":7435,"path":7436,"stem":7437},"API01-C. Avoid laying out strings in memory directly before sensitive data","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fapplication-programming-interfaces-api\u002Fapi01-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F02.application-programming-interfaces-api\u002F03.api01-c",{"title":7439,"path":7440,"stem":7441},"API02-C. Functions that read or write to or from an array should take an argument to specify the source or target size","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fapplication-programming-interfaces-api\u002Fapi02-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F02.application-programming-interfaces-api\u002F04.api02-c",{"title":7443,"path":7444,"stem":7445},"API03-C. Create consistent interfaces and capabilities across related functions","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fapplication-programming-interfaces-api\u002Fapi03-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F02.application-programming-interfaces-api\u002F05.api03-c",{"title":7447,"path":7448,"stem":7449},"API04-C. Provide a consistent and usable error-checking mechanism","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fapplication-programming-interfaces-api\u002Fapi04-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F02.application-programming-interfaces-api\u002F06.api04-c",{"title":7451,"path":7452,"stem":7453},"API05-C. Use conformant array parameters","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fapplication-programming-interfaces-api\u002Fapi05-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F02.application-programming-interfaces-api\u002F07.api05-c",{"title":7455,"path":7456,"stem":7457},"API07-C. Enforce type safety","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fapplication-programming-interfaces-api\u002Fapi07-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F02.application-programming-interfaces-api\u002F08.api07-c",{"title":7459,"path":7460,"stem":7461},"API09-C. Compatible values should have the same type","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fapplication-programming-interfaces-api\u002Fapi09-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F02.application-programming-interfaces-api\u002F09.api09-c",{"title":7463,"path":7464,"stem":7465},"API10-C. APIs should have security options enabled by default","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fapplication-programming-interfaces-api\u002Fapi10-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F02.application-programming-interfaces-api\u002F10.api10-c",{"title":6552,"path":7467,"stem":7468,"children":7469},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Farrays-arr","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F03.arrays-arr\u002F1.index",[7470,7471,7475,7479],{"title":6552,"path":7467,"stem":7468},{"title":7472,"path":7473,"stem":7474},"ARR00-C. Understand how arrays work","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Farrays-arr\u002Farr00-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F03.arrays-arr\u002F2.arr00-c",{"title":7476,"path":7477,"stem":7478},"ARR01-C. Do not apply the sizeof operator to a pointer when taking the size of an array","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Farrays-arr\u002Farr01-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F03.arrays-arr\u002F3.arr01-c",{"title":7480,"path":7481,"stem":7482},"ARR02-C. Explicitly specify array bounds, even if implicitly defined by an initializer","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Farrays-arr\u002Farr02-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F03.arrays-arr\u002F4.arr02-c",{"title":6582,"path":7484,"stem":7485,"children":7486},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fcharacters-and-strings-str","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F04.characters-and-strings-str\u002F01.index",[7487,7488,7492,7496,7500,7504,7508,7512,7516,7520,7524],{"title":6582,"path":7484,"stem":7485},{"title":7489,"path":7490,"stem":7491},"STR00-C. Represent characters using an appropriate type","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fcharacters-and-strings-str\u002Fstr00-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F04.characters-and-strings-str\u002F02.str00-c",{"title":7493,"path":7494,"stem":7495},"STR01-C. Adopt and implement a consistent plan for managing strings","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fcharacters-and-strings-str\u002Fstr01-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F04.characters-and-strings-str\u002F03.str01-c",{"title":7497,"path":7498,"stem":7499},"STR02-C. Sanitize data passed to complex subsystems","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fcharacters-and-strings-str\u002Fstr02-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F04.characters-and-strings-str\u002F04.str02-c",{"title":7501,"path":7502,"stem":7503},"STR03-C. Do not inadvertently truncate a string","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fcharacters-and-strings-str\u002Fstr03-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F04.characters-and-strings-str\u002F05.str03-c",{"title":7505,"path":7506,"stem":7507},"STR04-C. Use plain char for characters in the basic character set","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fcharacters-and-strings-str\u002Fstr04-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F04.characters-and-strings-str\u002F06.str04-c",{"title":7509,"path":7510,"stem":7511},"STR05-C. Use pointers to const when referring to string literals","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fcharacters-and-strings-str\u002Fstr05-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F04.characters-and-strings-str\u002F07.str05-c",{"title":7513,"path":7514,"stem":7515},"STR06-C. Do not assume that strtok() leaves the parse string unchanged","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fcharacters-and-strings-str\u002Fstr06-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F04.characters-and-strings-str\u002F08.str06-c",{"title":7517,"path":7518,"stem":7519},"STR09-C. Don't assume numeric values for expressions with type plain character","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fcharacters-and-strings-str\u002Fstr09-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F04.characters-and-strings-str\u002F09.str09-c",{"title":7521,"path":7522,"stem":7523},"STR10-C. Do not concatenate different type of string literals","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fcharacters-and-strings-str\u002Fstr10-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F04.characters-and-strings-str\u002F10.str10-c",{"title":7525,"path":7526,"stem":7527},"STR11-C. Do not specify the bound of a character array initialized with a string literal","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fcharacters-and-strings-str\u002Fstr11-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F04.characters-and-strings-str\u002F11.str11-c",{"title":6612,"path":7529,"stem":7530,"children":7531},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fconcurrency-con","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F05.concurrency-con\u002F01.index",[7532,7533,7537,7541,7545,7549,7553,7557,7561,7565],{"title":6612,"path":7529,"stem":7530},{"title":7534,"path":7535,"stem":7536},"CON01-C. Acquire and release synchronization primitives in the same module, at the same level of abstraction","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fconcurrency-con\u002Fcon01-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F05.concurrency-con\u002F02.con01-c",{"title":7538,"path":7539,"stem":7540},"CON02-C. Do not use volatile as a synchronization primitive","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fconcurrency-con\u002Fcon02-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F05.concurrency-con\u002F03.con02-c",{"title":7542,"path":7543,"stem":7544},"CON03-C. Ensure visibility when accessing shared variables","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fconcurrency-con\u002Fcon03-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F05.concurrency-con\u002F04.con03-c",{"title":7546,"path":7547,"stem":7548},"CON04-C. Join or detach threads even if their exit status is unimportant","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fconcurrency-con\u002Fcon04-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F05.concurrency-con\u002F05.con04-c",{"title":7550,"path":7551,"stem":7552},"CON05-C. Do not perform operations that can block while holding a lock","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fconcurrency-con\u002Fcon05-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F05.concurrency-con\u002F06.con05-c",{"title":7554,"path":7555,"stem":7556},"CON06-C. Ensure that every mutex outlives the data it protects","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fconcurrency-con\u002Fcon06-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F05.concurrency-con\u002F07.con06-c",{"title":7558,"path":7559,"stem":7560},"CON07-C. Ensure that compound operations on shared variables are atomic","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fconcurrency-con\u002Fcon07-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F05.concurrency-con\u002F08.con07-c",{"title":7562,"path":7563,"stem":7564},"CON08-C. Do not assume that a group of calls to independently atomic methods is atomic","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fconcurrency-con\u002Fcon08-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F05.concurrency-con\u002F09.con08-c",{"title":7566,"path":7567,"stem":7568},"CON09-C. Avoid the ABA problem when using lock-free algorithms","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fconcurrency-con\u002Fcon09-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F05.concurrency-con\u002F10.con09-c",{"title":6674,"path":7570,"stem":7571,"children":7572},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F01.index",[7573,7574,7578,7582,7586,7590,7594,7598,7602,7606,7610,7614,7618,7622,7626,7630,7634,7638,7642,7646,7650,7654,7658,7662],{"title":6674,"path":7570,"stem":7571},{"title":7575,"path":7576,"stem":7577},"DCL00-C. Const-qualify immutable objects","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl00-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F02.dcl00-c",{"title":7579,"path":7580,"stem":7581},"DCL01-C. Do not reuse variable names in subscopes","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl01-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F03.dcl01-c",{"title":7583,"path":7584,"stem":7585},"DCL02-C. Use visually distinct identifiers","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl02-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F04.dcl02-c",{"title":7587,"path":7588,"stem":7589},"DCL03-C. Use a static assertion to test the value of a constant expression","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl03-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F05.dcl03-c",{"title":7591,"path":7592,"stem":7593},"DCL04-C. Do not declare more than one variable per declaration","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl04-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F06.dcl04-c",{"title":7595,"path":7596,"stem":7597},"DCL05-C. Use typedefs of non-pointer types only","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl05-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F07.dcl05-c",{"title":7599,"path":7600,"stem":7601},"DCL06-C. Use meaningful symbolic constants to represent literal values","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl06-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F08.dcl06-c",{"title":7603,"path":7604,"stem":7605},"DCL07-C. Include the appropriate type information in function declarators","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl07-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F09.dcl07-c",{"title":7607,"path":7608,"stem":7609},"DCL08-C. Properly encode relationships in constant definitions","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl08-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F10.dcl08-c",{"title":7611,"path":7612,"stem":7613},"DCL09-C. Declare functions that return errno with a return type of errno_t","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl09-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F11.dcl09-c",{"title":7615,"path":7616,"stem":7617},"DCL10-C. Maintain the contract between the writer and caller of variadic functions","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl10-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F12.dcl10-c",{"title":7619,"path":7620,"stem":7621},"DCL11-C. Understand the type issues associated with variadic functions","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl11-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F13.dcl11-c",{"title":7623,"path":7624,"stem":7625},"DCL12-C. Implement abstract data types using opaque types","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl12-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F14.dcl12-c",{"title":7627,"path":7628,"stem":7629},"DCL13-C. Declare function parameters that are pointers to values not changed by the function as const","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl13-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F15.dcl13-c",{"title":7631,"path":7632,"stem":7633},"DCL15-C. Declare file-scope objects or functions that do not need external linkage as static","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl15-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F16.dcl15-c",{"title":7635,"path":7636,"stem":7637},"DCL16-C. Use \"L,\" not \"l,\" to indicate a long value","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl16-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F17.dcl16-c",{"title":7639,"path":7640,"stem":7641},"DCL17-C. Beware of miscompiled volatile-qualified variables","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl17-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F18.dcl17-c",{"title":7643,"path":7644,"stem":7645},"DCL18-C. Do not begin integer constants with 0 when specifying a decimal value","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl18-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F19.dcl18-c",{"title":7647,"path":7648,"stem":7649},"DCL19-C. Minimize the scope of variables and functions","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl19-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F20.dcl19-c",{"title":7651,"path":7652,"stem":7653},"DCL20-C. Explicitly specify void when a function accepts no arguments","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl20-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F21.dcl20-c",{"title":7655,"path":7656,"stem":7657},"DCL21-C. Understand the storage of compound literals","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl21-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F22.dcl21-c",{"title":7659,"path":7660,"stem":7661},"DCL22-C. Use volatile for data that cannot be cached","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl22-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F23.dcl22-c",{"title":7663,"path":7664,"stem":7665},"DCL23-C. Guarantee that mutually visible identifiers are unique","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fdeclarations-and-initialization-dcl\u002Fdcl23-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F06.declarations-and-initialization-dcl\u002F24.dcl23-c",{"title":6712,"path":7667,"stem":7668,"children":7669},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fenvironment-env","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F07.environment-env\u002F1.index",[7670,7671,7675,7679],{"title":6712,"path":7667,"stem":7668},{"title":7672,"path":7673,"stem":7674},"ENV01-C. Do not make assumptions about the size of an environment variable","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fenvironment-env\u002Fenv01-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F07.environment-env\u002F2.env01-c",{"title":7676,"path":7677,"stem":7678},"ENV02-C. Beware of multiple environment variables with the same effective name","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fenvironment-env\u002Fenv02-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F07.environment-env\u002F3.env02-c",{"title":7680,"path":7681,"stem":7682},"ENV03-C. Sanitize the environment when invoking external programs","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fenvironment-env\u002Fenv03-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F07.environment-env\u002F4.env03-c",{"title":6738,"path":7684,"stem":7685,"children":7686},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ferror-handling-err","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F08.error-handling-err\u002F1.index",[7687,7688,7690,7694,7698,7702,7706,7710],{"title":6738,"path":7684,"stem":7685},{"title":6128,"path":6127,"stem":7689},"4.sei-cert-c-coding-standard\u002F08.recommendations\u002F08.error-handling-err\u002F2.err00-c",{"title":7691,"path":7692,"stem":7693},"ERR01-C. Use ferror() rather than errno to check for FILE stream errors","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ferror-handling-err\u002Ferr01-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F08.error-handling-err\u002F3.err01-c",{"title":7695,"path":7696,"stem":7697},"ERR02-C. Avoid in-band error indicators","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ferror-handling-err\u002Ferr02-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F08.error-handling-err\u002F4.err02-c",{"title":7699,"path":7700,"stem":7701},"ERR04-C. Choose an appropriate termination strategy","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ferror-handling-err\u002Ferr04-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F08.error-handling-err\u002F5.err04-c",{"title":7703,"path":7704,"stem":7705},"ERR05-C. Application-independent code should provide error detection without dictating error handling","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ferror-handling-err\u002Ferr05-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F08.error-handling-err\u002F6.err05-c",{"title":7707,"path":7708,"stem":7709},"ERR06-C. Understand the termination behavior of assert() and abort()","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ferror-handling-err\u002Ferr06-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F08.error-handling-err\u002F7.err06-c",{"title":7711,"path":7712,"stem":7713},"ERR07-C. Prefer functions that support error checking over equivalent functions that don't","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ferror-handling-err\u002Ferr07-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F08.error-handling-err\u002F8.err07-c",{"title":6751,"path":7715,"stem":7716,"children":7717},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F01.index",[7718,7719,7723,7727,7731,7735,7739,7743,7747,7751,7755,7757,7761,7765,7769,7773,7777],{"title":6751,"path":7715,"stem":7716},{"title":7720,"path":7721,"stem":7722},"EXP00-C. Use parentheses for precedence of operation","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp\u002Fexp00-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F02.exp00-c",{"title":7724,"path":7725,"stem":7726},"EXP02-C. Be aware of the short-circuit behavior of the logical AND and OR operators","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp\u002Fexp02-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F03.exp02-c",{"title":7728,"path":7729,"stem":7730},"EXP03-C. Do not assume the size of a structure is the sum of the sizes of its members","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp\u002Fexp03-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F04.exp03-c",{"title":7732,"path":7733,"stem":7734},"EXP05-C. Do not cast away a const qualification","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp\u002Fexp05-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F05.exp05-c",{"title":7736,"path":7737,"stem":7738},"EXP07-C. Do not diminish the benefits of constants by assuming their values in expressions","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp\u002Fexp07-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F06.exp07-c",{"title":7740,"path":7741,"stem":7742},"EXP08-C. Ensure pointer arithmetic is used correctly","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp\u002Fexp08-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F07.exp08-c",{"title":7744,"path":7745,"stem":7746},"EXP09-C. Use sizeof to determine the size of a type or variable","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp\u002Fexp09-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F08.exp09-c",{"title":7748,"path":7749,"stem":7750},"EXP10-C. Do not depend on the order of evaluation of subexpressions or the order in which side effects take place","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp\u002Fexp10-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F09.exp10-c",{"title":7752,"path":7753,"stem":7754},"EXP11-C. Do not make assumptions regarding the layout of structures with bit-fields","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp\u002Fexp11-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F10.exp11-c",{"title":5686,"path":5685,"stem":7756},"4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F11.exp12-c",{"title":7758,"path":7759,"stem":7760},"EXP13-C. Treat relational and equality operators as if they were nonassociative","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp\u002Fexp13-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F12.exp13-c",{"title":7762,"path":7763,"stem":7764},"EXP14-C. Beware of integer promotion when performing bitwise operations on integer types smaller than int","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp\u002Fexp14-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F13.exp14-c",{"title":7766,"path":7767,"stem":7768},"EXP15-C. Do not place a semicolon on the same line as an if, for, or while statement","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp\u002Fexp15-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F14.exp15-c",{"title":7770,"path":7771,"stem":7772},"EXP16-C. Do not compare function pointers to constant values","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp\u002Fexp16-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F15.exp16-c",{"title":7774,"path":7775,"stem":7776},"EXP19-C. Use braces for the body of an if, for, or while statement","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp\u002Fexp19-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F16.exp19-c",{"title":7778,"path":7779,"stem":7780},"EXP20-C. Perform explicit tests to determine success, true and false, and equality","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fexpressions-exp\u002Fexp20-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F09.expressions-exp\u002F17.exp20-c",{"title":6816,"path":7782,"stem":7783,"children":7784},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ffloating-point-flp","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F10.floating-point-flp\u002F1.index",[7785,7786,7790,7794,7798,7802,7806,7810,7814],{"title":6816,"path":7782,"stem":7783},{"title":7787,"path":7788,"stem":7789},"FLP00-C. Understand the limitations of floating-point numbers","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ffloating-point-flp\u002Fflp00-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F10.floating-point-flp\u002F2.flp00-c",{"title":7791,"path":7792,"stem":7793},"FLP01-C. Take care in rearranging floating-point expressions","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ffloating-point-flp\u002Fflp01-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F10.floating-point-flp\u002F3.flp01-c",{"title":7795,"path":7796,"stem":7797},"FLP02-C. Avoid using floating-point numbers when precise computation is needed","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ffloating-point-flp\u002Fflp02-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F10.floating-point-flp\u002F4.flp02-c",{"title":7799,"path":7800,"stem":7801},"FLP03-C. Detect and handle floating-point errors","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ffloating-point-flp\u002Fflp03-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F10.floating-point-flp\u002F5.flp03-c",{"title":7803,"path":7804,"stem":7805},"FLP04-C. Check floating-point inputs for exceptional values","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ffloating-point-flp\u002Fflp04-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F10.floating-point-flp\u002F6.flp04-c",{"title":7807,"path":7808,"stem":7809},"FLP05-C. Do not use denormalized numbers","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ffloating-point-flp\u002Fflp05-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F10.floating-point-flp\u002F7.flp05-c",{"title":7811,"path":7812,"stem":7813},"FLP06-C. Convert integers to floating point for floating-point operations","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ffloating-point-flp\u002Fflp06-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F10.floating-point-flp\u002F8.flp06-c",{"title":7815,"path":7816,"stem":7817},"FLP07-C. Cast the return value of a function that returns a floating-point type","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Ffloating-point-flp\u002Fflp07-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F10.floating-point-flp\u002F9.flp07-c",{"title":6842,"path":7819,"stem":7820,"children":7821},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F01.index",[7822,7823,7827,7831,7835,7839,7843,7847,7851,7855,7859,7862,7866,7870,7874,7878,7882,7886,7890,7894,7898],{"title":6842,"path":7819,"stem":7820},{"title":7824,"path":7825,"stem":7826},"FIO01-C. Be careful using functions that use file names for identification","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio01-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F02.fio01-c",{"title":7828,"path":7829,"stem":7830},"FIO02-C. Canonicalize path names originating from tainted sources","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio02-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F03.fio02-c",{"title":7832,"path":7833,"stem":7834},"FIO03-C. Do not make assumptions about fopen() and file creation","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio03-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F04.fio03-c",{"title":7836,"path":7837,"stem":7838},"FIO05-C. Identify files using multiple file attributes","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio05-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F05.fio05-c",{"title":7840,"path":7841,"stem":7842},"FIO06-C. Create files with appropriate access permissions","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio06-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F06.fio06-c",{"title":7844,"path":7845,"stem":7846},"FIO08-C. Take care when calling remove() on an open file","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio08-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F07.fio08-c",{"title":7848,"path":7849,"stem":7850},"FIO09-C. Be careful with binary data when transferring data across systems","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio09-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F08.fio09-c",{"title":7852,"path":7853,"stem":7854},"FIO10-C. Take care when using the rename() function","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio10-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F09.fio10-c",{"title":7856,"path":7857,"stem":7858},"FIO11-C. Take care when specifying the mode parameter of fopen()","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio11-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F10.fio11-c",{"title":7860,"path":2695,"stem":7861},"FIO13-C. Never push back anything other than one read character","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F11.fio13-c",{"title":7863,"path":7864,"stem":7865},"FIO14-C. Understand the difference between text mode and binary mode with file streams","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio14-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F12.fio14-c",{"title":7867,"path":7868,"stem":7869},"FIO15-C. Ensure that file operations are performed in a secure directory","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio15-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F13.fio15-c",{"title":7871,"path":7872,"stem":7873},"FIO17-C. Do not rely on an ending null character when using fread()","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio17-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F14.fio17-c",{"title":7875,"path":7876,"stem":7877},"FIO18-C. Never expect fwrite() to terminate the writing process at a null character","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio18-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F15.fio18-c",{"title":7879,"path":7880,"stem":7881},"FIO19-C. Do not use fseek() and ftell() to compute the size of a regular file","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio19-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F16.fio19-c",{"title":7883,"path":7884,"stem":7885},"FIO20-C. Avoid unintentional truncation when using fgets() or fgetws()","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio20-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F17.fio20-c",{"title":7887,"path":7888,"stem":7889},"FIO21-C. Do not create temporary files in shared directories","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio21-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F18.fio21-c",{"title":7891,"path":7892,"stem":7893},"FIO22-C. Close files before spawning processes","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio22-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F19.fio22-c",{"title":7895,"path":7896,"stem":7897},"FIO23-C. Do not exit with unflushed data in stdout or stderr","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio23-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F20.fio23-c",{"title":7899,"path":7900,"stem":7901},"FIO24-C. Do not open a file that is already open","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Finput-output-fio\u002Ffio24-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F11.input-output-fio\u002F21.fio24-c",{"title":6900,"path":7903,"stem":7904,"children":7905},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fintegers-int","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F12.integers-int\u002F01.index",[7906,7907,7911,7915,7919,7923,7927,7931,7935,7939,7943,7947,7951,7955,7959,7963],{"title":6900,"path":7903,"stem":7904},{"title":7908,"path":7909,"stem":7910},"INT00-C. Understand the data model used by your implementation(s)","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fintegers-int\u002Fint00-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F12.integers-int\u002F02.int00-c",{"title":7912,"path":7913,"stem":7914},"INT01-C. Use size_t or rsize_t for all integer values representing the size of an object","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fintegers-int\u002Fint01-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F12.integers-int\u002F03.int01-c",{"title":7916,"path":7917,"stem":7918},"INT04-C. Enforce limits on integer values originating from tainted sources","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fintegers-int\u002Fint04-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F12.integers-int\u002F05.int04-c",{"title":7920,"path":7921,"stem":7922},"INT05-C. Do not use input functions to convert character data if they cannot handle all possible inputs","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fintegers-int\u002Fint05-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F12.integers-int\u002F06.int05-c",{"title":7924,"path":7925,"stem":7926},"INT07-C. Use only explicitly signed or unsigned char type for numeric values","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fintegers-int\u002Fint07-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F12.integers-int\u002F07.int07-c",{"title":7928,"path":7929,"stem":7930},"INT08-C. Verify that all integer values are in range","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fintegers-int\u002Fint08-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F12.integers-int\u002F08.int08-c",{"title":7932,"path":7933,"stem":7934},"INT09-C. Ensure enumeration constants map to unique values","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fintegers-int\u002Fint09-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F12.integers-int\u002F09.int09-c",{"title":7936,"path":7937,"stem":7938},"INT10-C. Do not assume a positive remainder when using the % operator","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fintegers-int\u002Fint10-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F12.integers-int\u002F10.int10-c",{"title":7940,"path":7941,"stem":7942},"INT12-C. Do not make assumptions about the type of a plain int bit-field when used in an expression","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fintegers-int\u002Fint12-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F12.integers-int\u002F11.int12-c",{"title":7944,"path":7945,"stem":7946},"INT13-C. Use bitwise operators only on unsigned operands","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fintegers-int\u002Fint13-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F12.integers-int\u002F12.int13-c",{"title":7948,"path":7949,"stem":7950},"INT14-C. Avoid performing bitwise and arithmetic operations on the same data","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fintegers-int\u002Fint14-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F12.integers-int\u002F13.int14-c",{"title":7952,"path":7953,"stem":7954},"INT15-C. Use intmax_t or uintmax_t for formatted IO on programmer-defined integer types","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fintegers-int\u002Fint15-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F12.integers-int\u002F14.int15-c",{"title":7956,"path":7957,"stem":7958},"INT16-C. Do not make assumptions about representation of signed integers","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fintegers-int\u002Fint16-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F12.integers-int\u002F15.int16-c",{"title":7960,"path":7961,"stem":7962},"INT17-C. Define integer constants in an implementation-independent manner","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fintegers-int\u002Fint17-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F12.integers-int\u002F16.int17-c",{"title":7964,"path":7965,"stem":7966},"INT18-C. Evaluate integer expressions in a larger size before comparing or assigning to that size","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fintegers-int\u002Fint18-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F12.integers-int\u002F17.int18-c",{"title":6934,"path":7968,"stem":7969,"children":7970},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmemory-management-mem","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F13.memory-management-mem\u002F01.index",[7971,7972,7976,7980,7984,7988,7991,7995,7999,8003,8007,8011],{"title":6934,"path":7968,"stem":7969},{"title":7973,"path":7974,"stem":7975},"MEM00-C. Allocate and free memory in the same module, at the same level of abstraction","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmemory-management-mem\u002Fmem00-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F13.memory-management-mem\u002F02.mem00-c",{"title":7977,"path":7978,"stem":7979},"MEM01-C. Store a new value in pointers immediately after free()","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmemory-management-mem\u002Fmem01-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F13.memory-management-mem\u002F03.mem01-c",{"title":7981,"path":7982,"stem":7983},"MEM02-C. Immediately cast the result of a memory allocation function call into a pointer to the allocated type","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmemory-management-mem\u002Fmem02-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F13.memory-management-mem\u002F04.mem02-c",{"title":7985,"path":7986,"stem":7987},"MEM03-C. Clear sensitive information stored in reusable resources","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmemory-management-mem\u002Fmem03-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F13.memory-management-mem\u002F05.mem03-c",{"title":7989,"path":3961,"stem":7990},"MEM04-C. Beware of zero-length allocations","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F13.memory-management-mem\u002F06.mem04-c",{"title":7992,"path":7993,"stem":7994},"MEM05-C. Avoid large stack allocations","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmemory-management-mem\u002Fmem05-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F13.memory-management-mem\u002F07.mem05-c",{"title":7996,"path":7997,"stem":7998},"MEM06-C. Ensure that sensitive data is not written out to disk","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmemory-management-mem\u002Fmem06-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F13.memory-management-mem\u002F08.mem06-c",{"title":8000,"path":8001,"stem":8002},"MEM07-C. Ensure that the arguments to calloc(), when multiplied, do not wrap","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmemory-management-mem\u002Fmem07-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F13.memory-management-mem\u002F09.mem07-c",{"title":8004,"path":8005,"stem":8006},"MEM10-C. Define and use a pointer validation function","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmemory-management-mem\u002Fmem10-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F13.memory-management-mem\u002F10.mem10-c",{"title":8008,"path":8009,"stem":8010},"MEM11-C. Do not assume infinite heap space","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmemory-management-mem\u002Fmem11-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F13.memory-management-mem\u002F11.mem11-c",{"title":8012,"path":5113,"stem":8013},"MEM12-C. Consider using a goto chain when leaving a function on error when using and releasing resources","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F13.memory-management-mem\u002F12.mem12-c",{"title":6964,"path":8015,"stem":8016,"children":8017},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmicrosoft-windows-win","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F14.microsoft-windows-win\u002F1.index",[8018,8019,8023,8027,8031,8035],{"title":6964,"path":8015,"stem":8016},{"title":8020,"path":8021,"stem":8022},"WIN00-C. Be specific when dynamically loading libraries","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmicrosoft-windows-win\u002Fwin00-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F14.microsoft-windows-win\u002F2.win00-c",{"title":8024,"path":8025,"stem":8026},"WIN01-C. Do not forcibly terminate execution","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmicrosoft-windows-win\u002Fwin01-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F14.microsoft-windows-win\u002F3.win01-c",{"title":8028,"path":8029,"stem":8030},"WIN02-C. Restrict privileges when spawning child processes","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmicrosoft-windows-win\u002Fwin02-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F14.microsoft-windows-win\u002F4.win02-c",{"title":8032,"path":8033,"stem":8034},"WIN03-C. Understand HANDLE inheritance","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmicrosoft-windows-win\u002Fwin03-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F14.microsoft-windows-win\u002F5.win03-c",{"title":8036,"path":8037,"stem":8038},"WIN04-C. Consider encrypting function pointers","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmicrosoft-windows-win\u002Fwin04-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F14.microsoft-windows-win\u002F6.win04-c",{"title":6974,"path":8040,"stem":8041,"children":8042},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F01.index",[8043,8044,8048,8052,8056,8060,8064,8068,8072,8076,8080,8084,8088,8092,8096,8100,8104,8108,8112,8116,8120,8124,8128],{"title":6974,"path":8040,"stem":8041},{"title":8045,"path":8046,"stem":8047},"MSC00-C. Compile cleanly at high warning levels","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc00-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F02.msc00-c",{"title":8049,"path":8050,"stem":8051},"MSC01-C. Strive for logical completeness","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc01-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F03.msc01-c",{"title":8053,"path":8054,"stem":8055},"MSC04-C. Use comments consistently and in a readable fashion","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc04-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F04.msc04-c",{"title":8057,"path":8058,"stem":8059},"MSC05-C. Do not manipulate time_t typed values directly","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc05-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F05.msc05-c",{"title":8061,"path":8062,"stem":8063},"MSC06-C. Beware of compiler optimizations","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc06-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F06.msc06-c",{"title":8065,"path":8066,"stem":8067},"MSC07-C. Detect and remove dead code","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc07-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F07.msc07-c",{"title":8069,"path":8070,"stem":8071},"UTF8-related issues","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Futf8-related-issues","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F08.utf8-related-issues",{"title":8073,"path":8074,"stem":8075},"MSC11-C. Incorporate diagnostic tests using assertions","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc11-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F09.msc11-c",{"title":8077,"path":8078,"stem":8079},"MSC12-C. Detect and remove code that has no effect or is never executed","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc12-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F10.msc12-c",{"title":8081,"path":8082,"stem":8083},"MSC13-C. Detect and remove unused values","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc13-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F11.msc13-c",{"title":8085,"path":8086,"stem":8087},"MSC14-C. Do not introduce unnecessary platform dependencies","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc14-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F12.msc14-c",{"title":8089,"path":8090,"stem":8091},"MSC15-C. Do not depend on undefined behavior","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc15-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F13.msc15-c",{"title":8093,"path":8094,"stem":8095},"MSC17-C. Finish every set of statements associated with a case label with a break statement","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc17-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F14.msc17-c",{"title":8097,"path":8098,"stem":8099},"MSC18-C. Be careful while handling sensitive data, such as passwords, in program code","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc18-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F15.msc18-c",{"title":8101,"path":8102,"stem":8103},"MSC19-C. For functions that return an array, prefer returning an empty array over a null value","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc19-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F16.msc19-c",{"title":8105,"path":8106,"stem":8107},"MSC20-C. Do not use a switch statement to transfer control into a complex block","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc20-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F17.msc20-c",{"title":8109,"path":8110,"stem":8111},"MSC21-C. Use robust loop termination conditions","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc21-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F18.msc21-c",{"title":8113,"path":8114,"stem":8115},"MSC22-C. Use the setjmp(), longjmp() facility securely","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc22-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F19.msc22-c",{"title":8117,"path":8118,"stem":8119},"MSC23-C. Beware of vendor-specific library and language differences","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc23-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F20.msc23-c",{"title":8121,"path":8122,"stem":8123},"MSC24-C. Do not use deprecated or obsolescent functions","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc24-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F21.msc24-c",{"title":8125,"path":8126,"stem":8127},"MSC25-C. Do not use insecure or weak cryptographic algorithms","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fmsc25-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F22.msc25-c",{"title":8129,"path":8130,"stem":8131},"Use subset of ASCII for safety","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fmiscellaneous-msc\u002Fuse-subset-of-ascii-for-safety","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F15.miscellaneous-msc\u002F23.use-subset-of-ascii-for-safety",{"title":7012,"path":8133,"stem":8134,"children":8135},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fposix-pos","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F16.posix-pos\u002F1.index",[8136,8137,8141,8145,8149],{"title":7012,"path":8133,"stem":8134},{"title":8138,"path":8139,"stem":8140},"POS01-C. Check for the existence of links when dealing with files","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fposix-pos\u002Fpos01-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F16.posix-pos\u002F2.pos01-c",{"title":8142,"path":8143,"stem":8144},"POS02-C. Follow the principle of least privilege","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fposix-pos\u002Fpos02-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F16.posix-pos\u002F3.pos02-c",{"title":8146,"path":8147,"stem":8148},"POS04-C. Avoid using PTHREAD_MUTEX_NORMAL type mutex locks","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fposix-pos\u002Fpos04-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F16.posix-pos\u002F4.pos04-c",{"title":8150,"path":8151,"stem":8152},"POS05-C. Limit access to files by creating a jail","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fposix-pos\u002Fpos05-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F16.posix-pos\u002F5.pos05-c",{"title":7082,"path":8154,"stem":8155,"children":8156},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fpreprocessor-pre","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F17.preprocessor-pre\u002F01.index",[8157,8158,8162,8166,8170,8174,8178,8182,8186,8190,8194,8198,8202,8206],{"title":7082,"path":8154,"stem":8155},{"title":8159,"path":8160,"stem":8161},"PRE00-C. Prefer inline or static functions to function-like macros","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fpreprocessor-pre\u002Fpre00-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F17.preprocessor-pre\u002F02.pre00-c",{"title":8163,"path":8164,"stem":8165},"PRE01-C. Use parentheses within macros around parameter names","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fpreprocessor-pre\u002Fpre01-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F17.preprocessor-pre\u002F03.pre01-c",{"title":8167,"path":8168,"stem":8169},"PRE02-C. Macro replacement lists should be parenthesized","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fpreprocessor-pre\u002Fpre02-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F17.preprocessor-pre\u002F04.pre02-c",{"title":8171,"path":8172,"stem":8173},"PRE04-C. Do not reuse a standard header file name","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fpreprocessor-pre\u002Fpre04-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F17.preprocessor-pre\u002F05.pre04-c",{"title":8175,"path":8176,"stem":8177},"PRE05-C. Understand macro replacement when concatenating tokens or performing stringification","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fpreprocessor-pre\u002Fpre05-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F17.preprocessor-pre\u002F06.pre05-c",{"title":8179,"path":8180,"stem":8181},"PRE06-C. Enclose header files in an include guard","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fpreprocessor-pre\u002Fpre06-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F17.preprocessor-pre\u002F07.pre06-c",{"title":8183,"path":8184,"stem":8185},"PRE07-C. Avoid using repeated question marks","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fpreprocessor-pre\u002Fpre07-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F17.preprocessor-pre\u002F08.pre07-c",{"title":8187,"path":8188,"stem":8189},"PRE08-C. Guarantee that header file names are unique","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fpreprocessor-pre\u002Fpre08-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F17.preprocessor-pre\u002F09.pre08-c",{"title":8191,"path":8192,"stem":8193},"PRE09-C. Do not replace secure functions with deprecated or obsolescent functions","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fpreprocessor-pre\u002Fpre09-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F17.preprocessor-pre\u002F10.pre09-c",{"title":8195,"path":8196,"stem":8197},"PRE10-C. Wrap multistatement macros in a do-while loop","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fpreprocessor-pre\u002Fpre10-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F17.preprocessor-pre\u002F11.pre10-c",{"title":8199,"path":8200,"stem":8201},"PRE11-C. Do not conclude macro definitions with a semicolon","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fpreprocessor-pre\u002Fpre11-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F17.preprocessor-pre\u002F12.pre11-c",{"title":8203,"path":8204,"stem":8205},"PRE12-C. Do not define unsafe macros","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fpreprocessor-pre\u002Fpre12-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F17.preprocessor-pre\u002F13.pre12-c",{"title":8207,"path":8208,"stem":8209},"PRE13-C. Use the Standard predefined macros to test for versions and features.","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fpreprocessor-pre\u002Fpre13-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F17.preprocessor-pre\u002F14.pre13-c",{"title":7100,"path":8211,"stem":8212,"children":8213},"\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fsignals-sig","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F18.signals-sig\u002F1.index",[8214,8215,8219,8223],{"title":7100,"path":8211,"stem":8212},{"title":8216,"path":8217,"stem":8218},"SIG00-C. Mask signals handled by noninterruptible signal handlers","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fsignals-sig\u002Fsig00-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F18.signals-sig\u002F2.sig00-c",{"title":8220,"path":8221,"stem":8222},"SIG01-C. Understand implementation-specific details regarding signal handler persistence","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fsignals-sig\u002Fsig01-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F18.signals-sig\u002F3.sig01-c",{"title":8224,"path":8225,"stem":8226},"SIG02-C. Avoid using signals to implement normal functionality","\u002Fsei-cert-c-coding-standard\u002Frecommendations\u002Fsignals-sig\u002Fsig02-c","4.sei-cert-c-coding-standard\u002F08.recommendations\u002F18.signals-sig\u002F4.sig02-c",{"title":8228,"path":8229,"stem":8230},"CERT manifest files","\u002Fsei-cert-c-coding-standard\u002Fcert-manifest-files","4.sei-cert-c-coding-standard\u002F09.cert-manifest-files",1775657799555]