View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0006406 | unreal | ircd | public | 2024-04-30 05:29 | 2025-11-20 11:29 |
| Reporter | andymandias | Assigned To | syzop | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | resolved | Resolution | fixed | ||
| Product Version | 6.1.5 | ||||
| Fixed in Version | 6.2.2 | ||||
| Summary | 0006406: RPL_LISTSTART terminated with crcrlf | ||||
| Description | After sending a LIST command the server responds with a RPL_LISTSTART message that is terminated with an extra carriage return (i.e. crcrlf instead of crlf). The rest of the messages sent by the server (the ones with the important data) are terminated with the expected crlf. | ||||
| Steps To Reproduce | 1. Connect to server. 2. Use /LIST (assuming SAFELIST has been marked as supported). | ||||
| 3rd party modules | |||||
|
|
This seems a bug in the labeled-response code for any multiline response, not just for LIST. It seems the first line after the BATCH (so RPL_LISTSTART in this case) always gets an extra 0x0d (\r). As the reporter mentioned, the other lines are fine. |
|
|
I think it starts with this problem: int lr_packet(Client *from, Client *to, Client *intended_to, char **msg, int *len) ... /* Add the label */ if (currentcmd.responses == 0) { int n = *len; if (n > sizeof(currentcmd.firstbuf)) n = sizeof(currentcmd.firstbuf); strlcpy(currentcmd.firstbuf, *msg, n); /* Don't send anything -- yet */ The '*len' would be the string lenght, but this is used as for 'n' which is used in strlcpy() which assumes the length also includes the nul byte So from the original_string\r\n it chops off the last character and becomes original_string\r. It should either chop off the entire \r\n and then re-add it later, or don't chop it off at all. |
|
|
I'll use strlncpy() so we don't have that sort of confusion :D |
|
|
Fixed in https://github.com/unrealircd/unrealircd/commit/a9ddc3768be8f02cce0b07a577fe7cde63fe7f29 Thanks for the report (and your patience)! :D commit a9ddc3768be8f02cce0b07a577fe7cde63fe7f29 (HEAD -> unreal60_dev, origin/unreal60_dev, origin/HEAD) Author: Bram Matthys <[email protected]> Date: Thu Nov 20 11:27:29 2025 +0100 Fix some lines ending with \r\r\n instead of \r\n with labeled-response. Reported by andymandias in https://bugs.unrealircd.org/view.php?id=6406 |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2024-04-30 05:29 | andymandias | New Issue | |
| 2024-05-03 13:14 | syzop | Assigned To | => syzop |
| 2024-05-03 13:14 | syzop | Status | new => confirmed |
| 2025-11-20 11:15 | syzop | Note Added: 0023568 | |
| 2025-11-20 11:23 | syzop | Note Added: 0023569 | |
| 2025-11-20 11:28 | syzop | Note Added: 0023570 | |
| 2025-11-20 11:29 | syzop | Status | confirmed => resolved |
| 2025-11-20 11:29 | syzop | Resolution | open => fixed |
| 2025-11-20 11:29 | syzop | Fixed in Version | => 6.2.2 |
| 2025-11-20 11:29 | syzop | Note Added: 0023571 |