[DTV00857290][[DTV][Coverity Scanned Code Defect] 15367: Out-of-bounds write]

[Description]
Fix coverity defects under common/
 - CID#2188332 "DC.CUSTOM_USE_RESTRICTED_FUNC" in wlan_lib.c:6933
 - CID#361792  "UNUSED_VALUE" in wlan_lib.c:3305,3314
 - CID#361791  "UNUSED_VALUE" in wlan_lib.c:3812,3821
 - CID#361790  "UNUSED_VALUE" in wlan_lib.c:2855,2864
 - CID#361781  "UNINIT" in wlan_lib.c:3725
 - CID#361778  "UNINIT" in wlan_lib.c:7802
 - CID#361477  "DEADCODE" in wlan_lib.c:7725
 - CID#361471  "DC.STRING_BUFFER" in wlan_lib.c:7934,7936,7982,
                                                7985,8007,8010
 - CID#361466  "CONSTANT_EXPRESSION_RESULT" in wlan_lib.c:862
 - CID#121824  "CONSTANT_EXPRESSION_RESULT" in n/wlan_oid.c:9168
 - CID#70779   "UNUSED_VALUE" in wlan_lib.c:2970,2979
 - CID#69920   "FORWARD_NULL" in wlan_lib.c:5969
 - CID#69865   "DEADCODE" in wlan_lib.c:8436
 - CID#16646   "UNREACHABLE" in wlan_p2p.c:1100
 - CID#16638   "UNREACHABLE" in wlan_p2p.c:1013
 - CID#15612   "OVERRUN" in wlan_p2p.c:850
 - CID#15517   "OVERRUN" in wlan_oid.c:3109
 - CID#15388   "OVERRUN" in wlan_oid.c:7178
 - CID#15295   "FORWARD_NULL" in wlan_oid.c:1139
 - CID#2222652 "NULL_RETURNS" in wlan_oid.c:12012
 - CID#2222651 "NULL_RETURNS" in wlan_oid.c:12080
 - CID#2190586 "OVERRUN" in wlan_oid.c:2502
   CID#2190583 "OVERRUN" in wlan_oid.c:2501
   CID#2190582 "OVERRUN" in wlan_oid.c:2496
 - CID#2188254 "CHECKED_RETURN" in wlan_lib.c:6772

Change-Id: I8142722eaf4fa2947e9f6047211fd4ccb8dc5113
Signed-off-by: Neil Chen <yn.chen@mediatek.com>
CR-Id: DTV00857290
(cherry picked from commit d97641365d312365d65ed00b810e333a371d1f95)
(cherry picked from commit 168c61db48e4b19e39394202cc9c9eeeb08f0d49)
3 files changed