diff options
author | Thomas White <taw@physics.org> | 2019-01-29 11:22:43 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-01-29 11:22:43 +0100 |
commit | eed808506effc4b43d4a1686112bf2f71a61e1fc (patch) | |
tree | da93b9b11935520f19f02b1b4a131a0d03d8bf71 /src | |
parent | 4f4e5d05269eee6b192c271f2f9730a1ad3a4fbd (diff) |
hdfsee: Fix possible string truncation
Diffstat (limited to 'src')
-rw-r--r-- | src/dw-hdfsee.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c index 76caaefd..cb35c2f5 100644 --- a/src/dw-hdfsee.c +++ b/src/dw-hdfsee.c @@ -2019,7 +2019,7 @@ static void numbers_update(DisplayWindow *dw) if ( found && (dw->image->features != NULL) ) { - char text[64]; + char text[1024+32+16]; f = image_feature_closest(dw->image->features, ffs, fss, fp, &dmin, &imin); @@ -2030,20 +2030,21 @@ static void numbers_update(DisplayWindow *dw) } strcat(text, " (panel "); - strncat(text, fp->name, 20); + strncat(text, fp->name, 1024); strcat(text, ")"); gtk_label_set_text(GTK_LABEL(dw->numbers_window->feat), text); } else if ( fp != NULL ) { - char text[64]; + char text[1024+16]; text[0] = '\0'; strcat(text, "Panel "); - strncat(text, fp->name, 20); + strncat(text, fp->name, 1024); gtk_label_set_text(GTK_LABEL(dw->numbers_window->feat), text); + } else { gtk_label_set_text(GTK_LABEL(dw->numbers_window->feat), "-"); } |