]> www.infradead.org Git - users/mchehab/rasdaemon.git/commit
rasdaemon: handle failures of snprintf()
authorAristeu Rozanski <arozansk@redhat.com>
Tue, 24 Jun 2014 15:01:31 +0000 (11:01 -0400)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 26 Jun 2014 12:30:58 +0000 (09:30 -0300)
commita5a96d2035257ba31f6bfcc8dcd7c3af5edd5ece
tree3e46699f4d03f3f2e48fb53c25e319da3a9fe6d1
parentf20a366a9b7a32a1be6fc89e7546cc2b4cb690bf
rasdaemon: handle failures of snprintf()

Florian Weimer found that in bitfield_msg() the return value of
snprintf() is used to calculate length ignoring that it can return a
negative number. This patch makes bitfield_msg() to stop writing in such
case.

Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1035741

Reported-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
bitfield.c