Module Name: src Committed By: riastradh Date: Wed Aug 3 21:20:21 UTC 2022
Modified Files: src/common/lib/libprop: prop_object.c Log Message: proplib: Don't run off end of buffer with memcmp. The input is required to be NUL-terminated anyway, so just use strcmp here. Reported-by: syzbot+69838802c8ec55909...@syzkaller.appspotmail.com https://syzkaller.appspot.com/bug?id=927d66e8aa079ba2be43497425a6d9878025ad09 To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/common/lib/libprop/prop_object.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/common/lib/libprop/prop_object.c diff -u src/common/lib/libprop/prop_object.c:1.32 src/common/lib/libprop/prop_object.c:1.33 --- src/common/lib/libprop/prop_object.c:1.32 Wed Aug 3 21:13:46 2022 +++ src/common/lib/libprop/prop_object.c Wed Aug 3 21:20:21 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_object.c,v 1.32 2022/08/03 21:13:46 riastradh Exp $ */ +/* $NetBSD: prop_object.c,v 1.33 2022/08/03 21:20:21 riastradh Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -735,7 +735,7 @@ _prop_object_internalize_context_alloc(c if (_PROP_EOF(*xml) || *xml != '<') goto bad; -#define MATCH(str) (memcmp(&xml[1], str, sizeof(str) - 1) == 0) +#define MATCH(str) (strcmp(&xml[1], str) == 0) /* * Skip over the XML preamble that Apple XML property