Skip to content

Commit

Permalink
Return error for WRITE command when stream ID exceeds limit. Fixes #19
Browse files Browse the repository at this point in the history
  • Loading branch information
chad-earthscope committed Dec 5, 2024
1 parent 4ae0e79 commit b0145e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
2024.338:
- Include server_port key in INFO CONNECTIONS response.
- Fix parsing of HTTP requests.
- Fix parsing of HTTP requests that required URL decoding.
- Fix and enhance HTTP /connections endpoint response.
- Document stream ID limitations and conventions in manual.
- Return error for WRITE command when stream ID exceeds limit.

2024.320: v4.0.0
NOTE: the ring buffer format has changed in this release. Older versions
Expand Down
10 changes: 10 additions & 0 deletions src/dlclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,16 @@ HandleWrite (ClientInfo *cinfo)
return -1;
}

if (strlen (streamid) > (MAXSTREAMID - 1))
{
lprintf (1, "[%s] Error, stream ID too long: %.100s",
cinfo->hostname, streamid);

SendPacket (cinfo, "ERROR", "Error, stream ID too long", 0, 1, 1);

return -1;
}

/* Set packet ID to RINGID_NONE if not provided */
if (rv == 5 || (rv == 6 && strchr (flags, 'I') == NULL))
{
Expand Down

0 comments on commit b0145e4

Please sign in to comment.