diff --git a/fs/fscache/object-list.c b/fs/fscache/object-list.c
index 67f940892ef810dca6710a7f7c14dc2acd9b2619..b5ab06fabc60a3bd0a7a308f45e4cb5b850398c1 100644
--- a/fs/fscache/object-list.c
+++ b/fs/fscache/object-list.c
@@ -262,7 +262,8 @@ static int fscache_objlist_show(struct seq_file *m, void *v)
 			type = "DT";
 			break;
 		default:
-			sprintf(_type, "%02u", cookie->def->type);
+			snprintf(_type, sizeof(_type), "%02u",
+				 cookie->def->type);
 			type = _type;
 			break;
 		}