proc_parse: check that scanf fill the offset var
proc_parse: check that scanf fill the offset var

CID 1168165 (#2 of 2): Untrusted array index read (TAINTED_SCALAR)
40. tainted_data: Using tainted variable "hoff" as an index into an
array "str"

$ man 3 scanf
n      Nothing  is expected; instead, the number of characters consumed
      thus far from the input is  stored  through  the  next  pointer,
      which  must  be  a  pointer  to  int.  This is not a conversion,
      although it can be suppressed with the *  assignment-suppression
      character.   The  C  standard says: "Execution of a %n directive
      does not increment the assignment count returned at the  comple‐
      tion of execution" but the Corrigendum seems to contradict this.
      Probably it is wise not to make any assumptions on the effect of
      %n conversions on the return value.

So it isn't not enough to check a return code from scanf().

Cc: Cyrill Gorcunov <7a1ea01eee6961eb1e372e3508c2670446d086f4@openvz.org>
Signed-off-by: Andrey Vagin <74c05afa918858348d6db8037d82fa8124870113@openvz.org>
Acked-by: Cyrill Gorcunov <7a1ea01eee6961eb1e372e3508c2670446d086f4@openvz.org>
Signed-off-by: Pavel Emelyanov <c9a32589e048e044184536f7ac71ef92fe82df3e@parallels.com>

marcosnils/criu,efiop/criu,gablg1/criu,svloyso/criu,svloyso/criu,efiop/criu,svloyso/criu,LK4D4/criu,efiop/criu,gablg1/criu,marcosnils/criu,eabatalov/criu,kawamuray/criu,rentzsch/criu,rentzsch/criu,ldu4/criu,kawamuray/criu,eabatalov/criu,LK4D4/criu,wtf42/criu,wtf42/criu,tych0/criu,kawamuray/criu,wtf42/criu,KKoukiou/criu-remote,LK4D4/criu,gonkulator/criu,ldu4/criu,KKoukiou/criu-remote,kawamuray/criu,tych0/criu,fbocharov/criu,ldu4/criu,ldu4/criu,gonkulator/criu,tych0/criu,biddyweb/criu,fbocharov/criu,KKoukiou/criu-remote,biddyweb/criu,sdgdsffdsfff/criu,AuthenticEshkinKot/criu,LK4D4/criu,biddyweb/criu,wtf42/criu,biddyweb/criu,KKoukiou/criu-remote,kawamuray/criu,gablg1/criu,fbocharov/criu,fbocharov/criu,AuthenticEshkinKot/criu,svloyso/criu,wtf42/criu,eabatalov/criu,eabatalov/criu,AuthenticEshkinKot/criu,gonkulator/criu,kawamuray/criu,AuthenticEshkinKot/criu,efiop/criu,marcosnils/criu,KKoukiou/criu-remote,wtf42/criu,gonkulator/criu,eabatalov/criu,tych0/criu,rentzsch/criu,marcosnils/criu,sdgdsffdsfff/criu,gonkulator/criu,sdgdsffdsfff/criu,tych0/criu,gablg1/criu,ldu4/criu,efiop/criu,sdgdsffdsfff/criu,LK4D4/criu,fbocharov/criu,gonkulator/criu,tych0/criu,marcosnils/criu,sdgdsffdsfff/criu,LK4D4/criu,rentzsch/criu,rentzsch/criu,fbocharov/criu,eabatalov/criu,gablg1/criu,efiop/criu,KKoukiou/criu-remote,gablg1/criu,ldu4/criu,svloyso/criu,AuthenticEshkinKot/criu,rentzsch/criu,AuthenticEshkinKot/criu,svloyso/criu,biddyweb/criu,marcosnils/criu,sdgdsffdsfff/criu,biddyweb/criu