[bug report] qedi: Add support for populating ethernet TLVs.

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

 



Hello Manish Rangankar,

The patch 534bbdf8832a: "qedi: Add support for populating ethernet
TLVs." from May 22, 2018, leads to the following static checker
warning:

	drivers/scsi/qedi/qedi_main.c:891 qedi_get_boot_tgt_info()
	error: snprintf() is printing too much 256 vs 255

drivers/scsi/qedi/qedi_main.c
   883  static void qedi_get_boot_tgt_info(struct nvm_iscsi_block *block,
   884                                     struct qedi_boot_target *tgt, u8 index)
   885  {
   886          u32 ipv6_en;
   887  
   888          ipv6_en = !!(block->generic.ctrl_flags &
   889                       NVM_ISCSI_CFG_GEN_IPV6_ENABLED);
   890  
   891          snprintf(tgt->iscsi_name, NVM_ISCSI_CFG_ISCSI_NAME_MAX_LEN, "%s\n",
                         ^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The buffer is one char smaller than NVM_ISCSI_CFG_ISCSI_NAME_MAX_LEN.

   892                   block->target[index].target_name.byte);
   893  
   894          tgt->ipv6_en = ipv6_en;
   895  
   896          if (ipv6_en)
   897                  snprintf(tgt->ip_addr, IPV6_LEN, "%pI6\n",
   898                           block->target[index].ipv6_addr.byte);
   899          else
   900                  snprintf(tgt->ip_addr, IPV4_LEN, "%pI4\n",
   901                           block->target[index].ipv4_addr.byte);
   902  }

regards,
dan carpenter



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux