Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2176946 | 7 | Peter Kessler | P3 | Closed | Fixed | b14 |
JDK-2171913 | 6u4 | Peter Kessler | P3 | Closed | Fixed | b03 |
call_jio_print(const char* s, size_t len) exists because jio_print(const char* s) doesn't take a length argument, instead assuming that its argument is null-terminated. call_jio_print carefully allocates a buffer, copies the correct number of characters from its argument to the buffer, null-terminates the buffer, and (but!) then hands the source argument to jio_print, which prints until it finds a null terminator.
In the most benign case, if the argument happens to be null-terminated in the right place, the correct result is produced. If the argument continues on past the given number of characters (e.g., it's a substring of a longer string), the argument is printed until its terminating null. In the case that the argument wasn't null terminated, but depended on the length, jio_print would wander off through memory finding things to print until it came to a null byte, seg-faulted, or whatever.
In the most benign case, if the argument happens to be null-terminated in the right place, the correct result is produced. If the argument continues on past the given number of characters (e.g., it's a substring of a longer string), the argument is printed until its terminating null. In the case that the argument wasn't null terminated, but depended on the length, jio_print would wander off through memory finding things to print until it came to a null byte, seg-faulted, or whatever.
- backported by
-
JDK-2171913 call_jio_print ignores its "len" argument
-
- Closed
-
-
JDK-2176946 call_jio_print ignores its "len" argument
-
- Closed
-