This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch main
in repository eradio.

View the commit online.

commit 94da62e846c740c00e6f953f12e453e693f2f087
Author: politebot <[email protected]>
AuthorDate: Wed Oct 22 18:49:00 2025 -0500

    Safer string functions
---
 src/http.c         | 11 ++++++++++-
 src/station_list.c | 27 ++++++++++++++++++++-------
 2 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/src/http.c b/src/http.c
index 7fb60cb..2a3599f 100644
--- a/src/http.c
+++ b/src/http.c
@@ -651,7 +651,16 @@ static void _retry_next_server_station(Ecore_Con_Url *old_url, Station_Download_
 
 static void _populate_counter_request(Counter_Download_Context *c_ctx, AppData *ad, const char *uuid)
 {
-   fprintf(stderr, "LOG: _populate_counter_request: ad=%p, ad->api_servers=%p\n", ad, ad ? ad->api_servers : NULL);
+   if (!ad) {
+       fprintf(stderr, "Error: ad is null in _populate_counter_request\n");
+       return;
+   }
+   if (!ad->api_servers) {
+       fprintf(stderr, "Error: ad->api_servers is null in _populate_counter_request\n");
+       return;
+   }
+
+   fprintf(stderr, "LOG: _populate_counter_request: ad=%p, ad->api_servers=%p\n", ad, ad->api_servers);
    strncpy(c_ctx->stationuuid, uuid, sizeof(c_ctx->stationuuid) - 1);
    c_ctx->servers = eina_list_clone(ad->api_servers);
    _prepend_selected_as_primary(&c_ctx->servers, ad->api_selected);
diff --git a/src/station_list.c b/src/station_list.c
index f004495..e067ea7 100644
--- a/src/station_list.c
+++ b/src/station_list.c
@@ -27,28 +27,41 @@ _gl_text_get(void *data, Evas_Object *obj, const char *part)
         {
             char bitrate_str[32];
             snprintf(bitrate_str, sizeof(bitrate_str), "%d kbps", st->bitrate);
-            strcat(info, bitrate_str);
+            size_t remaining = sizeof(info) - strlen(info);
+            snprintf(info + strlen(info), remaining, "%s", bitrate_str);
             first_item = EINA_FALSE;
         }
 
         if (st->codec && st->codec[0])
         {
-            if (!first_item) strcat(info, " | ");
-            strcat(info, st->codec);
+            if (!first_item) {
+                size_t remaining = sizeof(info) - strlen(info);
+                snprintf(info + strlen(info), remaining, " | ");
+            }
+            size_t remaining = sizeof(info) - strlen(info);
+            snprintf(info + strlen(info), remaining, "%s", st->codec);
             first_item = EINA_FALSE;
         }
 
         if (st->country && st->country[0])
         {
-            if (!first_item) strcat(info, " | ");
-            strcat(info, st->country);
+            if (!first_item) {
+                size_t remaining = sizeof(info) - strlen(info);
+                snprintf(info + strlen(info), remaining, " | ");
+            }
+            size_t remaining = sizeof(info) - strlen(info);
+            snprintf(info + strlen(info), remaining, "%s", st->country);
             first_item = EINA_FALSE;
         }
 
         if (st->language && st->language[0])
         {
-            if (!first_item) strcat(info, " | ");
-            strcat(info, st->language);
+            if (!first_item) {
+                size_t remaining = sizeof(info) - strlen(info);
+                snprintf(info + strlen(info), remaining, " | ");
+            }
+            size_t remaining = sizeof(info) - strlen(info);
+            snprintf(info + strlen(info), remaining, "%s", st->language);
             first_item = EINA_FALSE;
         }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to