@@ -228,11 +228,11 @@ static int afs_xattr_get_yfs(const struct xattr_handler *handler,
228
228
break ;
229
229
case 1 :
230
230
data = buf ;
231
- dsize = snprintf (buf , sizeof (buf ), "%u" , yacl -> inherit_flag );
231
+ dsize = scnprintf (buf , sizeof (buf ), "%u" , yacl -> inherit_flag );
232
232
break ;
233
233
case 2 :
234
234
data = buf ;
235
- dsize = snprintf (buf , sizeof (buf ), "%u" , yacl -> num_cleaned );
235
+ dsize = scnprintf (buf , sizeof (buf ), "%u" , yacl -> num_cleaned );
236
236
break ;
237
237
case 3 :
238
238
data = yacl -> vol_acl -> data ;
@@ -370,13 +370,15 @@ static int afs_xattr_get_fid(const struct xattr_handler *handler,
370
370
/* The volume ID is 64-bit, the vnode ID is 96-bit and the
371
371
* uniquifier is 32-bit.
372
372
*/
373
- len = sprintf (text , "%llx:" , vnode -> fid .vid );
373
+ len = scnprintf (text , sizeof ( text ) , "%llx:" , vnode -> fid .vid );
374
374
if (vnode -> fid .vnode_hi )
375
- len += sprintf (text + len , "%x%016llx" ,
376
- vnode -> fid .vnode_hi , vnode -> fid .vnode );
375
+ len += scnprintf (text + len , sizeof ( text ) - len , "%x%016llx" ,
376
+ vnode -> fid .vnode_hi , vnode -> fid .vnode );
377
377
else
378
- len += sprintf (text + len , "%llx" , vnode -> fid .vnode );
379
- len += sprintf (text + len , ":%x" , vnode -> fid .unique );
378
+ len += scnprintf (text + len , sizeof (text ) - len , "%llx" ,
379
+ vnode -> fid .vnode );
380
+ len += scnprintf (text + len , sizeof (text ) - len , ":%x" ,
381
+ vnode -> fid .unique );
380
382
381
383
if (size == 0 )
382
384
return len ;
0 commit comments