Author: cy
Date: Sun Apr 16 01:15:37 2017
New Revision: 316994
URL: https://svnweb.freebsd.org/changeset/base/316994

Log:
  Fix CID 1372600, possible NULL pointer dereference should
  reallocarray() fail.
  
  Reported by:  Coverity CID 1372600
  MFC after:    1 week

Modified:
  head/contrib/ipfilter/tools/ipf_y.y

Modified: head/contrib/ipfilter/tools/ipf_y.y
==============================================================================
--- head/contrib/ipfilter/tools/ipf_y.y Sun Apr 16 01:13:47 2017        
(r316993)
+++ head/contrib/ipfilter/tools/ipf_y.y Sun Apr 16 01:15:37 2017        
(r316994)
@@ -2195,6 +2195,10 @@ char *phrase;
                        for (i = 0, s = strtok(phrase, " \r\n\t"); s != NULL;
                             s = strtok(NULL, " \r\n\t"), i++) {
                                fb = reallocarray(fb, i / 4 + 1, sizeof(*fb));
+                               if (fb == NULL) {
+                                       perror("memory allocation error at 
__LINE__ in __FUNCTION__ in __FILE");
+                                       abort();
+                               }
                                l = (u_32_t)strtol(s, NULL, 0);
                                switch (i & 3)
                                {
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to