I retired a year and a half ago after having worked for twenty-six years as a programmer for Apple. I’m not sure which would have been more surprising: if I had continued programming in my spare time after I had retired or if I never programmed again.
This is a (non-comprehensive) guide for C# and .NET developers that are completely new to the Rust programming language. Some concepts and constructs translate fairly well between C#/.NET and Rust, but which may be expressed differently, whereas others are a radical departure, like memory management. This guide provides a brief comparison and mapping of those constructs and concepts with concise examples.
آسیبپذیری integer overflow در Git 2.39 و نسخههای قبلتر از آن
در نسخه 2.39 و نسخههای قبلتر از آن دو آسیبپذیری جدید پیدا شده است که منجر به integer overflow میشوند؛ اولی مربوط به git log --format است که حین استفاده از padding operatorها اگر آفست بزرگی پاس داده شود رخ خواهد داد. دومی هم مربوط به پارزر gitattribute است؛ که حین بارگذاری فایل از ایندکس اگر محتویات نامعتبری در آن باشد رخ خواهد داد. همچنین در Git GUI ویندوز نیز موقع clone کردن یک مخزن گیت یکسری post-processing بر روی branch دیفالتی که checkout میشود انجام خواهد شد به عنوان مثال یکی از این فازها spell-checker است؛ در حین انجام این پردازشها ممکن است یک مخزنی حاوی untrusted codeهایی باشد.
جزئیات هر کدام از این آسیبپذیریها را میتوانید در لینک مشاهده کنید؛ برای رفع این مشکل بهتر است ورژن Git خود را بروزرسانی کنید. در غیراینصورت باید حین کار با untrusted repositories از فلاگ --format و همچنین git archive استفاده نکنید. همچنین بهتر است از Git GUI برای کار با untrusted repositories استفاده نکنید.
List<int> normalList = new List<int> { 1, 2, 3 }; ReadOnlyCollection<int> readonlyList = normalList.AsReadOnly(); FrozenSet<int> frozenSet = normalList.ToFrozenSet(); ImmutableList<int> immutableList = normalList.ToImmutableList(); normalList.Add(4); Console.WriteLine($"List count: {normalList.Count}"); Console.WriteLine($"ReadOnlyList count: {readonlyList.Count}"); Console.WriteLine($"FrozenSet count: {frozenSet.Count}"); Console.WriteLine($"ImmutableList count: {immutableList.Count}");