[gnome-nettool] Fixed Array may be overflowed.



commit 3af471ab0e9710f49c4db5dddb4e511594547833
Author: Marc Ruiz - radykal - <radykal radykal com>
Date:   Wed Aug 1 12:20:59 2012 +0200

    Fixed Array may be overflowed.
    
    Replaced with g_snprintf a g_sprintf call which could produce an
    array overflow.
    
    https://bugzilla.gnome.org/review?bug=680660
    
    Signed-off-by: GermÃn Poo-CaamaÃo <gpoo gnome org>

 src/lookup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/lookup.c b/src/lookup.c
index 28ea46e..536d287 100644
--- a/src/lookup.c
+++ b/src/lookup.c
@@ -255,7 +255,7 @@ strip_line (gchar * line, lookup_data * data)
 	
 	if (count == LOOKUP_NUM_ARGS) {
 		g_sprintf (data->record_type, "MX");
-		g_sprintf (data->destination, "%s (%s)", host_mx, priority);
+		g_snprintf (data->destination, 128,"%s (%s)", host_mx, priority);
 	} else {
 		count = sscanf (line, LOOKUP_FORMAT,
 				data->source, &(data)->ttl, data->addr_type,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]