▁because ▁it ▁fails ▁to ▁fully ▁initialize ▁the ▁members ▁of ▁struct ▁student ▁new _ student . ▁If ▁we ▁take ▁a ▁closer ▁look , ▁in ▁the ▁beginning , ▁age , ▁sem ester ▁and ▁student _ number ▁are ▁initialized . ▁But ▁the ▁initialization ▁of ▁the ▁first _ name ▁and ▁last _ name ▁members ▁are ▁incorrect . ▁This ▁is ▁because ▁if ▁the ▁length ▁of ▁first _ name ▁and ▁last _ name ▁character ▁arrays ▁are ▁less ▁than ▁ 1 6 ▁bytes , ▁during ▁the ▁str cpy , ▁we ▁fail ▁to ▁fully ▁initialize ▁the ▁entire ▁ 1 6 ▁bytes ▁of ▁memory ▁reserved ▁for ▁each ▁of ▁these ▁members . ▁Hence ▁after ▁mem cpy () ' ing ▁the ▁resulted ▁struct ▁to ▁output , ▁we ▁leak ▁some ▁stack ▁memory ▁to ▁the ▁caller . ▁ ▁struct ▁student ▁{ ▁▁▁▁ ▁unsigned ▁int ▁age ; ▁▁▁▁ ▁unsigned ▁int ▁sem ester ; ▁▁▁▁ ▁char ▁first _ name [ 1 6 ]; ▁▁▁▁ ▁char ▁last _ name [ 1 6 ]; ▁▁▁▁ ▁unsigned ▁int ▁student _ number ; ▁}; ▁ ▁int ▁register _ student ( struct ▁student ▁* output , ▁int ▁age , ▁char ▁* first _ name , ▁char ▁* last _ name ) ▁{ ▁▁▁▁ ▁// ▁If ▁any ▁of ▁these ▁pointers ▁are ▁Null , ▁we ▁fail . ▁▁▁▁ ▁if ▁(! output ▁|| ▁! first _ name ▁|| ▁! last _ name ) ▁▁▁▁ ▁{ ▁▁▁▁▁▁▁▁ ▁printf (" Error !\ n "); ▁▁▁▁▁▁▁▁ ▁return ▁- 1 ; ▁▁▁▁ ▁} ▁▁▁▁▁ ▁// ▁We ▁make ▁sure ▁the ▁length ▁of ▁the ▁strings ▁are ▁less ▁than ▁ 1 6 ▁bytes