diff --git a/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp
index c9d315a..f835b2c 100644
--- a/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp
@@ -241,10 +241,18 @@ void MallocOverflowSecurityChecker::checkASTCodeBody(const Decl *D,
         if (const CallExpr *TheCall = dyn_cast<CallExpr>(CS->getStmt())) {
           // Get the callee.
           const FunctionDecl *FD = TheCall->getDirectCallee();
-
           if (!FD)
             return;
 
+          // Check the parameter specified by attribute alloc_size.
+          const AllocSizeAttr* A = FD->getAttr<AllocSizeAttr>();
+          if (A && A->args_size() == 1) {
+            unsigned ArgIdx = *A->args_begin();
+            CheckMallocArgument(PossibleMallocOverflows, TheCall->getArg(ArgIdx),
+                                mgr.getASTContext());
+            continue;
+          }
+
           // Get the name of the callee. If it's a builtin, strip off the prefix.
           IdentifierInfo *FnInfo = FD->getIdentifier();
           if (!FnInfo)
diff --git a/test/Analysis/malloc-overflow.c b/test/Analysis/malloc-overflow.c
index 714fd3d..329d2dc 100644
--- a/test/Analysis/malloc-overflow.c
+++ b/test/Analysis/malloc-overflow.c
@@ -111,3 +111,10 @@ void * f14(int n)
     return NULL;
   return malloc(n * sizeof(int));  // expected-warning {{the computation of the size of the memory allocation may overflow}}
 }
+
+extern void * my_malloc(size_t) __attribute__((alloc_size(1)));
+
+void * f15(int n)
+{
+  return my_malloc(n * sizeof(int));  // expected-warning {{the computation of the size of the memory allocation may overflow}}
+}
