Entering >15 stocks causes crash and repeated reboots #291

Closed
opened 2025-03-15 22:42:05 +00:00 by lyricnz · 6 comments
lyricnz commented 2025-03-15 22:42:05 +00:00 (Migrated from github.com)

After #268 adding too many stocks causes crash/reboot loop @dreed47

After #268 adding too many stocks causes crash/reboot loop @dreed47
lyricnz commented 2025-03-15 22:49:36 +00:00 (Migrated from github.com)

Also, adding 0 stocks causes bad behaviour:

00:00:10.285 I: 🔵 Starting HTTP request for: https://api.twelvedata.com/quote?apikey=e03fc53524454ab8b65d91b23c669cc5&symbol=
00:00:12.145 I: ✅ Release semaphore
00:00:12.146 W: skipping invalid data for: 
Also, adding 0 stocks causes bad behaviour: ``` 00:00:10.285 I: 🔵 Starting HTTP request for: https://api.twelvedata.com/quote?apikey=e03fc53524454ab8b65d91b23c669cc5&symbol= 00:00:12.145 I: ✅ Release semaphore 00:00:12.146 W: skipping invalid data for: ```
lyricnz commented 2025-03-15 23:11:40 +00:00 (Migrated from github.com)

Also, for me at least, loading the stocks is slower than the 10-second refresh, so at bootup, it ends up chasing the data updates...

Also, for me at least, loading the stocks is slower than the 10-second refresh, so at bootup, it ends up chasing the data updates...
lyricnz commented 2025-03-16 02:01:33 +00:00 (Migrated from github.com)

Looks like a bounds-check off-by-one (zero based):

    m_stockCount = 0;
    do {
        if (m_stockCount > MAX_STOCKS) {
            Log.warningln("MAX STOCKS UNABLE TO ADD MORE");
            break;
        }

The > should be `>='. Added to #292

Looks like a bounds-check off-by-one (zero based): ```cpp m_stockCount = 0; do { if (m_stockCount > MAX_STOCKS) { Log.warningln("MAX STOCKS UNABLE TO ADD MORE"); break; } ``` The `>` should be `>='. Added to #292
lyricnz commented 2025-03-16 02:50:13 +00:00 (Migrated from github.com)

PR #292 is fixed. There's still an issue if someone enters "" (no stocks).

PR #292 is fixed. There's still an issue if someone enters "" (no stocks).
lyricnz commented 2025-03-16 03:05:38 +00:00 (Migrated from github.com)

Or enters bad characters, like quotes etc.

Or enters bad characters, like quotes etc.
lyricnz commented 2025-03-17 06:33:53 +00:00 (Migrated from github.com)

Split other validation issues to #299

Split other validation issues to #299
Sign in to join this conversation.
No description provided.