Knowledge (XXG)

Null character

Source 📝

137:. This allows the string to be any length with only the overhead of one byte; the alternative of storing a count requires either a string length limit of 255 or an overhead of more than one byte (there are other advantages/disadvantages described in the 122:, the character is represented with no holes at all, so a new unpunched tape is initially filled with null characters, and often text could be inserted at a reserved space of null characters by punching the new characters into the tape over the nulls. 535:, p. 38: "The character constant '\0' represents the character with value zero, the null character. '\0' is often written instead of 0 to emphasize the character nature of some expression, but the numeric value is just 0."}} 226:
The ability to represent a null character does not always mean the resulting string will be correctly interpreted, as many programs will consider the null to be the end of the string. Thus the ability to type it (in case of
117:
were used as computer output devices, one or more null characters were sent at the end of each printed line to allow time for the mechanism to return to the first printing position on the next line. On
321:
In all modern character sets, the null character has a code point value of zero. In most encodings, this is translated to a single code unit with a zero value. For instance, in
495: 463:, shall exist in the basic execution character set; it is used to terminate a character string literal." — ANSI/ISO 9899:1990 (the ANSI C standard), section 5.2.1 499: 476:
is a contiguous sequence of characters terminated by and including the first null character" — ANSI/ISO 9899:1990 (the ANSI C standard), section 7.1.1
196:; otherwise it is interpreted as the start of a longer octal escape sequence. Other escape sequences that are found in use in various languages are 737: 624: 355: 389: 333:. This allows the byte with the value of zero, which is now not used for any character, to be used as a string terminator. 63: 20: 732: 180:, which introduced this notation), this is not a separate escape sequence, but an octal escape sequence with a single 129:
and its derivatives and in many data formats, where it serves as a reserved character used to signify the end of a
232: 130: 516:, or NTBS, is a character sequence whose highest-addressed element with defined content has the value zero (the 701: 685: 126: 59: 138: 134: 582: 177: 369: 228: 75: 597: 486: 665: 617: 110: 416: 106: 35: 359: 217: 102: 377:
NUL (Null): The all-zeros character which may serve to accomplish time fill and media fill.
711: 349: 293: 154: 610: 243: 161: 726: 706: 655: 39: 591: 576: 561: 680: 670: 549: 119: 87: 650: 396: 274: 150: 114: 51: 43: 436: 675: 660: 588: 372: 98: 634: 125:
Today the character has much more significance in the programming language
292:
In documentation, the null character is sometimes represented as a single-
594: 297: 109:, it has no effect (some terminals, however, incorrectly display it as 67: 602: 395:. Secretariat ISO/TC 97/SC 2. 1975-12-01. p. 4.4. Archived from 364: 282: 71: 250:. On some keyboards, one can enter a null character by holding down 326: 322: 181: 55: 545: 47: 606: 213: 520:); no other element in the sequence has the value zero. 564:
WASC Threat Classification Null Byte Attack section.
488:
Working Draft, Standard for Programming Language C++
172:); the latter may also be written instead simply as 86:, though in some contexts that term is used for the 579:
WASC Threat Classification Null Byte Attack section
153:, the null character is often represented as the 97:The original meaning of this character was like 296:-width symbol containing the letters "NUL". In 176:(without quotes nor slash). In many languages ( 502:, 28 February 2011, p. 427, N3242=11-0012 390:"The set of control characters of the ISO 646" 618: 8: 404:Position: 0/0, Name: Null, Abbreviation: Nul 329:the null character is encoded as two bytes: 74:. It is available in nearly all mainstream 459:"A byte with all bits set to 0, called the 38:with the value zero. It is present in many 625: 611: 603: 188:must not be followed by any of the digits 363: 266:will often work, there being no need for 267: 263: 259: 255: 251: 341: 325:it is a single zero byte. However, in 212:. A null character can be placed in a 16:Control character whose bits are all 0 7: 494:(ISO 14882 standard working draft), 351:ASCII format for Network Interchange 90:). In 8-bit codes, it is known as a 417:"Unicode Character 'NULL' (U+0000)" 239:and can lead to security exploits. 14: 300:, there is a character for this: 42:, including those defined by the 585:Introduction to Null Byte Attack 289:also yields the null character. 1: 583:Poison Null Byte Introduction 437:"C0 Controls and Basic Latin" 168:) or in character constants ( 78:. It is often abbreviated as 64:Universal Coded Character Set 514:null-terminated byte string 184:digit 0; as a consequence, 756: 738:Computer security exploits 518:terminating null character 442:. Unicode Consortium. 2018 113:). When electromechanical 18: 694: 641: 702:Null coalescing operator 686:Null coalescing operator 550:separate escape sequence 531:Kernighan and Ritchie, 548:this combination is a 246:the null character is 139:null-terminated string 135:null-terminated string 101:—when sent to a 277:notation for null is 76:programming languages 270:to get the @ sign). 258:(on US layouts just 229:unchecked user input 19:For other uses, see 666:Null object pattern 592:null byte injection 577:Null Byte Injection 562:Null Byte Injection 237:null byte injection 733:Control characters 720: 719: 358:. sec. 5.2. 133:, often called a 36:control character 745: 627: 620: 613: 604: 565: 559: 553: 542: 536: 529: 523: 522: 509: 507: 493: 483: 477: 470: 464: 457: 451: 450: 448: 447: 441: 433: 427: 426: 424: 423: 413: 407: 406: 401: 394: 386: 380: 379: 367: 365:10.17487/RFC0020 346: 332: 312: 309: 306: 304: 288: 280: 249: 222: 211: 207: 203: 199: 195: 191: 187: 175: 171: 167: 159: 755: 754: 748: 747: 746: 744: 743: 742: 723: 722: 721: 716: 712:Undefined value 690: 637: 631: 573: 568: 560: 556: 543: 539: 530: 526: 505: 503: 491: 485: 484: 480: 471: 467: 458: 454: 445: 443: 439: 435: 434: 430: 421: 419: 415: 414: 410: 402:on 2014-05-12. 399: 392: 388: 387: 383: 348: 347: 343: 339: 330: 319: 311:SYMBOL FOR NULL 310: 307: 302: 301: 286: 281:. Decoding the 278: 269: 265: 261: 257: 253: 247: 220: 209: 205: 201: 197: 193: 189: 185: 173: 169: 165: 162:string literals 157: 155:escape sequence 147: 60:C0 control code 32:null terminator 24: 17: 12: 11: 5: 753: 752: 749: 741: 740: 735: 725: 724: 718: 717: 715: 714: 709: 704: 695: 692: 691: 689: 688: 683: 678: 673: 668: 663: 658: 653: 648: 646:Null character 642: 639: 638: 632: 630: 629: 622: 615: 607: 601: 600: 586: 580: 572: 571:External links 569: 567: 566: 554: 537: 524: 478: 465: 461:null character 452: 428: 408: 381: 340: 338: 335: 327:Modified UTF-8 318: 315: 244:caret notation 164:(for example, 146: 145:Representation 143: 40:character sets 28:null character 15: 13: 10: 9: 6: 4: 3: 2: 751: 750: 739: 736: 734: 731: 730: 728: 713: 710: 708: 707:Nullable type 705: 703: 700: 697: 696: 693: 687: 684: 682: 679: 677: 674: 672: 669: 667: 664: 662: 659: 657: 656:Null function 654: 652: 649: 647: 644: 643: 640: 636: 628: 623: 621: 616: 614: 609: 608: 605: 599: 598:vulnerability 596: 593: 590: 587: 584: 581: 578: 575: 574: 570: 563: 558: 555: 551: 547: 541: 538: 534: 528: 525: 521: 519: 515: 501: 497: 490: 489: 482: 479: 475: 469: 466: 462: 456: 453: 438: 432: 429: 418: 412: 409: 405: 398: 391: 385: 382: 378: 374: 371: 366: 361: 357: 353: 352: 345: 342: 336: 334: 328: 324: 316: 314: 299: 295: 290: 284: 276: 271: 254:and pressing 245: 240: 238: 234: 233:vulnerability 230: 224: 219: 215: 183: 179: 163: 156: 152: 144: 142: 140: 136: 132: 128: 123: 121: 116: 112: 108: 104: 100: 95: 93: 89: 85: 81: 77: 73: 69: 65: 61: 57: 53: 49: 45: 41: 37: 33: 29: 22: 698: 671:Null pointer 645: 557: 540: 532: 527: 517: 513: 511: 504:, retrieved 487: 481: 473: 468: 460: 455: 444:. Retrieved 431: 420:. Retrieved 411: 403: 397:the original 384: 376: 350: 344: 320: 291: 272: 241: 236: 231:) creates a 225: 218:percent code 148: 124: 120:punched tape 115:teleprinters 96: 91: 88:null pointer 83: 79: 31: 27: 25: 681:Null string 676:Null in SQL 651:Null device 506:27 February 275:Hexadecimal 151:source code 52:ISO/IEC 646 21:Null symbol 727:Categories 661:Null modem 446:2018-10-20 422:2018-10-20 337:References 166:"abc\0def" 141:article). 699:See also: 635:computing 633:Nulls in 331:0xC0,0x80 235:known as 216:with the 178:such as C 92:null byte 317:Encoding 308:␀ 192:through 107:terminal 595:QR code 298:Unicode 285:string 268:⇧ Shift 103:printer 70:), and 68:Unicode 58:), the 50:codes, 34:) is a 474:string 305: 303:U+2400 283:Base64 210:\u0000 131:string 72:EBCDIC 62:, the 44:Baudot 30:(also 589:Apple 492:(PDF) 440:(PDF) 400:(PDF) 393:(PDF) 323:UTF-8 208:, or 182:octal 111:space 105:or a 56:ASCII 546:YAML 508:2013 356:IETF 287:AA== 273:The 260:Ctrl 252:Ctrl 202:\x00 198:\000 170:'\0' 84:NULL 82:(or 66:(or 54:(or 48:ITA2 46:and 26:The 544:In 500:IEC 496:ISO 472:"A 370:RFC 360:doi 242:In 221:%00 214:URL 160:in 149:In 99:NOP 80:NUL 729:: 512:A 510:, 375:. 373:20 368:. 354:. 313:. 294:em 279:00 248:^@ 223:. 206:\z 204:, 200:, 186:\0 158:\0 94:. 626:e 619:t 612:v 552:. 533:C 498:/ 449:. 425:. 362:: 264:2 262:+ 256:@ 194:7 190:0 174:0 127:C 23:.

Index

Null symbol
control character
character sets
Baudot
ITA2
ISO/IEC 646
ASCII
C0 control code
Universal Coded Character Set
Unicode
EBCDIC
programming languages
null pointer
NOP
printer
terminal
space
teleprinters
punched tape
C
string
null-terminated string
null-terminated string
source code
escape sequence
string literals
such as C
octal
URL
percent code

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.