# HG changeset patch # User nicodvb # Date 1172927431 0 # Node ID 963d93b2fe7c7395b75560ea1624d6aa67109a6d # Parent 0fd3c34a31272323084782a95f3266591372f560 replaced 2 instances of sprintf() with snprintf() and one instance of strncpy() followed by string termination with strlcpy(); patch by njkain gmail com. This patch is intended to render code easier to audit against buffer oveflows diff -r 0fd3c34a3127 -r 963d93b2fe7c stream/stream_dvb.c --- a/stream/stream_dvb.c Sat Mar 03 08:20:00 2007 +0000 +++ b/stream/stream_dvb.c Sat Mar 03 13:10:31 2007 +0000 @@ -176,8 +176,7 @@ ptr->name = (char*) malloc(k+1); if(! ptr->name) continue; - strncpy(ptr->name, line, k); - ptr->name[k] = 0; + strlcpy(ptr->name, line, k+1); } else continue; @@ -764,7 +763,7 @@ conf->cards = NULL; for(i=0; icards[conf->count].devno = i; conf->cards[conf->count].list = list; conf->cards[conf->count].type = type; - sprintf(name, "DVB-%c card n. %d", type==TUNER_TER ? 'T' : (type==TUNER_CBL ? 'C' : 'S'), conf->count+1); + snprintf(name, 20, "DVB-%c card n. %d", type==TUNER_TER ? 'T' : (type==TUNER_CBL ? 'C' : 'S'), conf->count+1); conf->cards[conf->count].name = name; conf->count++; }