⬢ DragonFlyBSD Kernel Audit
DF-5720 / fix.diff
← back to finding ↓ download raw
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -361,12 +361,17 @@
 		t = db_read_token();
 		if (t == tSLASH) {
 		    t = db_read_token();
-		    if (t != tIDENT && t != tNUMBER) {
+		    if (t == tIDENT) {
+			db_strcpy(modif, db_tok_string);
+		    } else if (t == tNUMBER) {
+			/* db_tok_string is only populated for tIDENT. */
+			ksnprintf(modif, sizeof(modif), "%ld",
+				  (long)db_tok_number);
+		    } else {
 			db_printf("Bad modifier\n");
 			db_flush_lex();
 			return;
 		    }
-		    db_strcpy(modif, db_tok_string);
 		}
 		else {
 		    db_unread_token(t);